mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.cz>
To: Hannes Reinecke <hare@suse.de>
Cc: James Bottomley <jbottomley@parallels.com>,
	Christoph Hellwig <hch@infradead.org>,
	linux-scsi@vger.kernel.org, Robert Elliott <elliott@hp.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 27/38] Rearrange buffer formatting in printk()
Date: Tue, 30 Sep 2014 21:37:14 +0200	[thread overview]
Message-ID: <20140930193714.GH2707@dhcp128.suse.cz> (raw)
In-Reply-To: <20140930161619.GF2707@dhcp128.suse.cz>

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 <rostedt@goodmis.org>
> > Cc: LKML <linux-kernel@vger.kernel.org>
> 
> printk stuff is maintained by Andrew in mm tree, so adding him into CC.
> 
> > Signed-off-by: Hannes Reinecke <hare@suse.de>
> 
> Reviewed-by: Petr Mladek <pmladek@suse.cz>

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 <pmladek@suse.cz>

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/

  reply	other threads:[~2014-09-30 19:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1411991947-130166-1-git-send-email-hare@suse.de>
2014-09-29 11:58 ` Hannes Reinecke
2014-09-30 16:16   ` Petr Mladek
2014-09-30 19:37     ` Petr Mladek [this message]
2014-09-29 11:58 ` [PATCH 28/38] Externalize string buffer for printk Hannes Reinecke
2014-09-30 16:39   ` Petr Mladek
2014-09-30 18:52     ` Hannes Reinecke
2014-09-29 11:58 ` [PATCH 29/38] Introduce dev_printk_string() and dev_printk_header() Hannes Reinecke
2014-09-29 16:58   ` Greg Kroah-Hartman
2014-09-30  5:48     ` Hannes Reinecke
2014-09-29 11:59 ` [PATCH 33/38] libata: use __scsi_print_command() Hannes Reinecke
2014-09-29 14:06   ` Tejun Heo
2014-09-29 14:10     ` Hannes Reinecke
2014-09-29 14:11       ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140930193714.GH2707@dhcp128.suse.cz \
    --to=pmladek@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=elliott@hp.com \
    --cc=hare@suse.de \
    --cc=hch@infradead.org \
    --cc=jbottomley@parallels.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®