Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1398468ybh; Sun, 19 Jul 2020 18:53:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwieVvupgbHbSNDqeaFTpQW7p4FGJA8JppqHcbomC055XXCCyZPaTeHcpD0qH3uOimL9Eks X-Received: by 2002:aa7:c54f:: with SMTP id s15mr20133121edr.175.1595210019289; Sun, 19 Jul 2020 18:53:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595210019; cv=none; d=google.com; s=arc-20160816; b=oWHMBmtASnvytwBDAmjiZaRiYz007BrxN1htJFPQtQyaNTDUbfPnUMkIIGi1L1DuJf wXsamHa/7ZwOrDQXr5KXuZceA9XXpK2UMGhb02qVRdxuXF8vkqkz2toP/7EQeZ5G2edk 522t/Nd4IJwZSch3987XBDVzQfNTF21Xr/sLLwufV3pTSlIUtCgahwAuSlNMtUg4e8Pm T76kg8Jro2K+W+YPhQDBatJAsBjouGtCmA5HSIOBXSyqmUBljJBwqZdCOOYuJYekSyjV MIGvukiP4jP4W1pQXaSyUQreunXLuhBwyUnRVE7eXYL89XXEzfYm2cTgdLSVkXoQHAHW X1Ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=O7ndZbT5qEKJ/XEIAl77Slw4yrcNUd2ImapnvXMAGJg=; b=Z1TJfnpiDGDMcl7jQCxlWQ28XtKSZ1h1k3LfA/tRrgI/abnveXCPpEqSNrSk8j3ZiR 6Eaibjt+jpRcU2v0mmYr1nAu3/7el6Ov20nrWDNF/pwAGGnGUq8Y9IG9rIJQstJmquXZ ELCeQHFSUNGZtfSBn54q4Dikdq6yUmxql/+wgPX5HO83fIk5w/C/sHmbCAc1vOJbyReN 6p4BatUDIzhXA8pvyvUvJuAcsyUm0DyoTOmlvYj1FfXIBTaWXmcFAj0r3xXLcO3tYduh Mf2BgpEHcUwVoX3iXlx90uaWu2kLTQZebEgckHiAbyzCqGc0r+yG4kCd84hD6UwvVFld bLMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rhCK9Muj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j18si10612009edp.389.2020.07.19.18.53.16; Sun, 19 Jul 2020 18:53:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rhCK9Muj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726648AbgGTBvB (ORCPT + 99 others); Sun, 19 Jul 2020 21:51:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726225AbgGTBvA (ORCPT ); Sun, 19 Jul 2020 21:51:00 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5239FC0619D2 for ; Sun, 19 Jul 2020 18:51:00 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id p1so7954803pls.4 for ; Sun, 19 Jul 2020 18:51:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=O7ndZbT5qEKJ/XEIAl77Slw4yrcNUd2ImapnvXMAGJg=; b=rhCK9MujJTfDVyJrSZRsFYeBlPLhGmBShAMAJF55rDi7a80Ws+5VZsoW7rds38aBOL V/Vjb9uH2hHcdjU+5de/4G71YUI3P+xfqQYYRXe85aaA1b2AN7gwHjNMeQvOQRNvOefs FTZq6YF8YTMY4rcHkBZOWNfCqqF+W+4sya6qnBKnfIA7HkVa/p4vsG96LKj2lCMuBYUR SJOBSBXjgon/aiwAIzqptFC/tTh0TaurYIoh0hmpz0D/cO2Bwg+6S3wNwJf3zgC7wr8W 94Ln/CLWgaO31vRtK0f00NbCT082RontR+dnnp8PaO0ArtN27KVyw54KbSCcnLKYUKne UpUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=O7ndZbT5qEKJ/XEIAl77Slw4yrcNUd2ImapnvXMAGJg=; b=tGiXbZ8m/67CKQ72g1aqO+UE/rJk8QeNRuEjBVyhIBVd0nnsZc7+1JMQcAOyCsTzh5 hDne6VsKVuuawRNeuOZh/exr5zJPYjADMxWqsuKdyWnOJf70J7517hgTeDR3Ji8kiBXE ROZDMBJ10mhH2NaRshaB0uS2oxlFHi0Q0ql5GUvyGBqWOwHIF4Z2Nmib5abXrNydjUaO LD5IUm8NYiSysWgPJ8t9DDmgagtq7/o1dQN43cRxNthBkZ9BSuhm+TldtlQALYKJ6xDi P32N2RBO9YBQT7CWinlIxKbHt+0IxJCCU1z7ltbCnzhU9w5iq3JViSzpwEThP89Zn80i DgFw== X-Gm-Message-State: AOAM532y2nsUU/y5aRU7DIdJ0JvCPPqr7hB2RxiU5LEfUfPKuXbWMCd5 TBrkiHA4B+RupObYNphRX5U= X-Received: by 2002:a17:90a:89:: with SMTP id a9mr21971215pja.171.1595209859713; Sun, 19 Jul 2020 18:50:59 -0700 (PDT) Received: from localhost ([2409:10:2e40:5100:6e29:95ff:fe2d:8f34]) by smtp.gmail.com with ESMTPSA id c132sm14720972pfb.112.2020.07.19.18.50.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Jul 2020 18:50:59 -0700 (PDT) Date: Mon, 20 Jul 2020 10:50:57 +0900 From: Sergey Senozhatsky To: Linus Torvalds Cc: Sergey Senozhatsky , John Ogness , Petr Mladek , Sergey Senozhatsky , Steven Rostedt , Greg Kroah-Hartman , Peter Zijlstra , Thomas Gleixner , kexec@lists.infradead.org, Linux Kernel Mailing List Subject: Re: [PATCH 2/4] printk: store instead of processing cont parts Message-ID: <20200720015057.GA463@jagdpanzerIV.localdomain> References: <20200717234818.8622-1-john.ogness@linutronix.de> <20200717234818.8622-3-john.ogness@linutronix.de> <20200719143527.GA566@jagdpanzerIV.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (20/07/19 11:27), Linus Torvalds wrote: > On Sun, Jul 19, 2020 at 7:35 AM Sergey Senozhatsky > wrote: > > > > Can we merge lines that we don't want to merge? > > > > pr_cont() -> IRQ -> pr_cont() -> NMI -> pr_cont() > > That pr_cont in either IRQ or NMI context would be a bug. > > You can't validly have a PR_CONT without the non-cont that precedes it. Do I get it right, what you are saying is - when we process a PR_CONT message the cont buffer should already contain previous non-LOG_NEWLINE and non-PR_CONT message, otherwise it's a bug? lockdep (I'll trim the code) static void __print_lock_name(struct lock_class *class) { .. name = class->name; if (!name) { name = __get_key_name(class->key, str); printk(KERN_CONT "%s", name); } else { printk(KERN_CONT "%s", name); if (class->name_version > 1) printk(KERN_CONT "#%d", class->name_version); if (class->subclass) printk(KERN_CONT "/%d", class->subclass); } } static void print_lock_name(struct lock_class *class) { printk(KERN_CONT " ("); __print_lock_name(class); printk(KERN_CONT "){%s}-{%hd:%hd}", usage, ... } static void print_bad_irq_dependency(struct task_struct *curr, { .. pr_warn("which would create a new lock dependency:\n"); print_lock_name(hlock_class(prev)); pr_cont(" ->"); print_lock_name(hlock_class(next)); pr_cont("\n"); .. } pr_warn() is LOG_NEWLINE, so cont buffer is empty by the time we call print_lock_name()->__print_lock_name(), which do several pr_cont() print outs. I'm quite sure there is more code that does similar things. But, overall, isn't it by design that we can process pr_cont() message with no preceding non-cont message? Because of preliminary flushes. Example: CPU0 pr_info("foo"); // !LOG_NEWLINE goes into the cont buffer pr_cont("1"); // OK -> IRQ / NMI / exception / etc pr_alert("error\n"); // flush cont buffer, log_store error message (it's LOG_NEWLINE) <- iret pr_cont("2"); // cont buffer was flushed. There is no preceding non-cont message pr_cont("3"); pr_cont("\n"); Or am I misunderstanding what you saying? -ss