Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp651988imm; Wed, 20 Jun 2018 04:33:45 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJoXH0MUcGCmK5KjNalE8so+nPyfTEewPvJb6tKwD/c5WjfUolJylVENxNdvlJrHmrlz4Fx X-Received: by 2002:a65:5844:: with SMTP id s4-v6mr18720871pgr.417.1529494424976; Wed, 20 Jun 2018 04:33:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529494424; cv=none; d=google.com; s=arc-20160816; b=K2dT5XYG17zNbJrHq2yIxVGKwThBehhJzfV8Btezcq/jI2XUP/weqMSrjAEaAYS0gJ FXVGJ8qGo6chgglrlFmFJm/xnqp2qrU5nKYZIp8qINKIGx7JXGbgt0XL4qGKY/Me6sQR 0P7K01GAh/+MPA0ZEaDwaw50CdcJga8RVrqcmY3IbU2usRK7rmoHqrXpkh095Y/Pg33l 4AmACba6EApeRW4zMQqtujkLnbhBgE8TCIuMsK13rppw1fkZNusQ/r2X8wyxdzrzUY8E 0nqGANj26SSu2T2p6tMjCCleWFZKfv23Zfc6X84uZzW/Ztq5qlIUkQo7jqns2kRjH2IY 4KFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=y0+djVGhA6riyyXJNog/IxCc1PvKjVtmM8gQdG4Pues=; b=KzAjknxg8sWWE/42NN239yYEcGg3i+zRbLTWQg5tgM2SDY0UNe7+GG0eGxRMiQUP4n uuANyH8VMcF52kadI9mnBLSmRnCiQdgp4pOCSoUpPMEQ6cOxsZzRSklRHdxZ7QvhmweU PCuQkZtHfajeq0XAkPoyQcI2oioeDwpXnVki+Rj6r1WbyUujxQWxbh8B5tjD3laK5mpT q0j+spY+h2g91ngGMfNeYhIQhOOlafClpzzKKccxJZEdq/MSN6DXcp5piIlRT0TGznNr LGyygmnpOKVpsmfJh7iyW4WoEwYZBM3O2ZvbBhR68KrhP6BvLZJC6IrtC/OBvprXHZ1o Xuog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=WZnDCD8O; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a4-v6si2058343pfi.353.2018.06.20.04.33.30; Wed, 20 Jun 2018 04:33:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=WZnDCD8O; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752914AbeFTLca (ORCPT + 99 others); Wed, 20 Jun 2018 07:32:30 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:32869 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751337AbeFTLc2 (ORCPT ); Wed, 20 Jun 2018 07:32:28 -0400 Received: by mail-pl0-f67.google.com with SMTP id 6-v6so1631486plb.0 for ; Wed, 20 Jun 2018 04:32:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=y0+djVGhA6riyyXJNog/IxCc1PvKjVtmM8gQdG4Pues=; b=WZnDCD8OglBfOwvcf+JPH6FH4XKqcu+CN8E3QPu2ajwXcp1sAGAC8Y9UeRgcMdxzNA 2VbcThohY3hsNuSjJmXWF7zzQ0GcjvPBMPP730Z5KMPj0BiI6bv0+iXKDmpv63w2U3vp 9xjAzsbWIjL3NXa2QhVHGK455K9zHhXBDRRljt8nKqqgJPrOhN48yr/87HL7BvIuyB6F BqWVxb7VbGybRjU1DP4lH7zM92yTrbQI7VppjCqzhTorxNWjFZIxB/R6TNJ0/KFVWwXV M3B0woRbWo3MnL0Oe37/KRrH6vPdFhBHBFhcV2v5W0DBoxeiujDK5alKwFDUCSgiG7xi n6dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=y0+djVGhA6riyyXJNog/IxCc1PvKjVtmM8gQdG4Pues=; b=W/5nJnxzkItiylwdtZWRSwTWSb9ty+G7+ioHs87Ao7r7UI05dSPZBI8gXj3UClMlTt MU0vz5DIQd7aMQc3MBEhqbgRZiByVfmwH/IfqhYOihGPkt1GWP1fAAYfEbr52TwRKqOD LNlpFTHgpRKa7qZpDgQBqj7EDucA3Ff7MMXwzSli5V6WfHbihiXHToawL2gRI2c7YC0S XSvpppsGvOl2HOooO3PRT43VO/oLGzE9+gVTcR8ksAGqTpifBEgMzGTO/MDPvdMNAv24 orF80Mh+8NeMapOIIMrjXwBmAys1ubN0fhvH7ZnRvKU8YEHb2wtuPnEBJpSpRirLgn3G S5Vg== X-Gm-Message-State: APt69E2TsGBNKBwnzTq5miXk2TGF44EPzqAsi5x8x/Iq3P5z1sI15Ihi JGc6wXy2Z/DbgRdFm9m3J3vUiLoWab8Ifv5nH56qpA== X-Received: by 2002:a17:902:8d85:: with SMTP id v5-v6mr23315407plo.93.1529494348120; Wed, 20 Jun 2018 04:32:28 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a17:90a:de2:0:0:0:0 with HTTP; Wed, 20 Jun 2018 04:32:07 -0700 (PDT) In-Reply-To: <20180620110759.GD444@jagdpanzerIV> References: <20180517112135.GB20796@jagdpanzerIV> <20180518121506.wilixxkznbtskw34@pathway.suse.cz> <20180524021451.GA23443@jagdpanzerIV> <20180620083126.GA477@jagdpanzerIV> <20180620090413.GA444@jagdpanzerIV> <20180620091541.GB444@jagdpanzerIV> <20180620110759.GD444@jagdpanzerIV> From: Dmitry Vyukov Date: Wed, 20 Jun 2018 13:32:07 +0200 Message-ID: Subject: Re: [PATCH] printk: inject caller information into the body of message To: Sergey Senozhatsky Cc: Petr Mladek , Tetsuo Handa , Sergey Senozhatsky , syzkaller , Steven Rostedt , Fengguang Wu , LKML , Linus Torvalds , Andrew Morton Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 20, 2018 at 1:07 PM, Sergey Senozhatsky wrote: > On (06/20/18 11:31), Dmitry Vyukov wrote: >> > BTW, pr_cont() handling is not so simple when we are in printk_safe() >> > context. Unlike vprintk_emit() [normal printk], we don't use any >> > dedicated pr_cont() buffer in printk_safe. So, at a glance, I suspect >> > that injecting context info at every printk_safe_log_store() call for >> > `for (...) pr_cont()' loop is going to produce something like this: >> > I<10> 23 I<10> 43 I<10> 47 .... >> > >> > // Hmm, maybe the line will endup having two prefixes. Once >> > // from printk_safe_log_store, the other from normal printk >> > // log_store(). >> > >> > While the same `for (...) pr_cont()' called from normal printk() context >> > will produce >> > I<10> 32 43 47 .... >> > >> > It could be that I'm wrong. >> > Tetsuo, have you tested pr_cont() from printk_safe() context? >> >> >> So this is another reason to get rid of pr_cont entirely, right? > > Getting rid of pr_cont() from important output would be totally cool. > Quoting Linus: > > Only acceptable use of continuations is basically boot-time testing, > when you do things like > > printk("Testing feature XYZ.."); > this_may_blow_up_because_of_hw_bugs(); > printk(KERN_CONT " ... ok\n"); > > > I can recall at least 4 attempts when people tried to introduce new pr_cont() > or some concept with similar functionality to pr_cont(), but SMP safe. We > brought the first one - per-CPU pr_cont() buffers - to KS several years ago > but Linus didn't like it. Then there was a buffered printk() mode patch from > Tetsuo, then a solution from Steven, then I had my second try with a > soft-of-pr_cont() replacement. > > So, if we could get rid of pr_cont() from the most important parts > (instruction dumps, etc) then I would just vote to leave pr_cont() > alone and avoid any handling of it in printk context tracking. Simply > because we wouldn't care about pr_cont(). This also could simplify > Tetsuo's patch significantly. Sounds good to me.