From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752521AbaI3Th2 (ORCPT ); Tue, 30 Sep 2014 15:37:28 -0400 Received: from cantor2.suse.de ([195.135.220.15]:44747 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751952AbaI3Th0 (ORCPT ); Tue, 30 Sep 2014 15:37:26 -0400 Date: Tue, 30 Sep 2014 21:37:14 +0200 From: Petr Mladek To: Hannes Reinecke Cc: James Bottomley , Christoph Hellwig , linux-scsi@vger.kernel.org, Robert Elliott , Steven Rostedt , Andrew Morton , LKML Subject: Re: [PATCH 27/38] Rearrange buffer formatting in printk() Message-ID: <20140930193714.GH2707@dhcp128.suse.cz> References: <1411991947-130166-1-git-send-email-hare@suse.de> <1411991947-130166-28-git-send-email-hare@suse.de> <20140930161619.GF2707@dhcp128.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140930161619.GF2707@dhcp128.suse.cz> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 30-09-14 18:16:20, Petr Mladek wrote: > On Mon 29-09-14 13:58:56, Hannes Reinecke wrote: > > Move buffer formatting to the start of the function as it > > doesn't require to be done under any locks. > > No functional change, required by the next patch. > > > > Cc: Steven Rostedt > > Cc: LKML > > printk stuff is maintained by Andrew in mm tree, so adding him into CC. > > > Signed-off-by: Hannes Reinecke > > Reviewed-by: Petr Mladek I have just realized that textbuf[LOG_LINE_MAX] is a static variable. It means that it must be used under the lock and this patch is wrong. I want to take back the Reviewed-by and instead do Nacked->by: Petr Mladek also it means that it does not take the extra space on the stack and you probably does not need the two patches at all. Best Regards, Petr > I do not see any obvious problem. Just note that > [sched_delayed] has already been removed in -mm tree. You might > want to base this patch on top of the commit 460d73c35ffa17979422290 > ("printk: git rid of [sched_delayed] message for printk_deferred") > from linux-next. > > Best Regards, > Petr > > > --- > > kernel/printk/printk.c | 21 ++++++++++----------- > > 1 file changed, 10 insertions(+), 11 deletions(-) > > > > diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c > > index 1ce7706..d13675e 100644 > > --- a/kernel/printk/printk.c > > +++ b/kernel/printk/printk.c > > @@ -1633,8 +1633,18 @@ asmlinkage int vprintk_emit(int facility, int level, > > if (level == SCHED_MESSAGE_LOGLEVEL) { > > level = -1; > > in_sched = true; > > + > > + /* > > + * The printf needs to come first; we need the syslog > > + * prefix which might be passed-in as a parameter. > > + */ > > + text_len = scnprintf(text, sizeof(textbuf), > > + KERN_WARNING "[sched_delayed] "); > > } > > > > + text_len += vscnprintf(text + text_len, > > + sizeof(textbuf) - text_len, fmt, args); > > + > > boot_delay_msec(level); > > printk_delay(); > > > > @@ -1676,17 +1686,6 @@ asmlinkage int vprintk_emit(int facility, int level, > > strlen(recursion_msg)); > > } > > > > - /* > > - * The printf needs to come first; we need the syslog > > - * prefix which might be passed-in as a parameter. > > - */ > > - if (in_sched) > > - text_len = scnprintf(text, sizeof(textbuf), > > - KERN_WARNING "[sched_delayed] "); > > - > > - text_len += vscnprintf(text + text_len, > > - sizeof(textbuf) - text_len, fmt, args); > > - > > /* mark and strip a trailing newline */ > > if (text_len && text[text_len-1] == '\n') { > > text_len--; > > -- > > 1.8.5.2 > > > > -- > > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > > the body of a message to majordomo@vger.kernel.org > > More majordomo info at http://vger.kernel.org/majordomo-info.html > > Please read the FAQ at http://www.tux.org/lkml/ > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/