Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1498232

Re: [RFC][PATCHv2 6/7] printk: report printk recursion from alt_printk flush

From Petr Mladek <pmladek@suse.com>
Newsgroups linux.kernel
Subject Re: [RFC][PATCHv2 6/7] printk: report printk recursion from alt_printk flush
Date 2016-10-10 13:10 +0200
Message-ID <sqGD0-wr-19@gated-at.bofh.it> (permalink)
References <sn7Lr-3r4-3@gated-at.bofh.it> <sn7V8-3uh-19@gated-at.bofh.it> <spj5M-2ak-9@gated-at.bofh.it> <sqxzH-3b1-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sat 2016-10-08 03:59:20, Sergey Senozhatsky wrote:
> On (10/06/16 17:41), Petr Mladek wrote:
> [..]
> > > +	if (this_cpu_read(alt_printk_ctx) & ALT_PRINTK_RECURSION_MASK) {
> > > +		const char *msg = "BUG: recent printk recursion!\n";
> > > +
> > > +		this_cpu_and(alt_printk_ctx, ~ALT_PRINTK_RECURSION_MASK);
> > > +		alt_printk_flush_line(msg, strlen(msg));
> > > +	}
> > > +
> > >  	/*
> > >  	 * This is just a paranoid check that nobody has manipulated
> > >  	 * the buffer an unexpected way. If we printed something then
> > > @@ -290,6 +297,8 @@ static int vprintk_alt(const char *fmt, va_list args)
> > >  {
> > >  	struct alt_printk_seq_buf *s = this_cpu_ptr(&alt_print_seq);
> > >  
> > > +	/* There is only one way to get here -- a printk recursion. */
> > > +	this_cpu_or(alt_printk_ctx, ALT_PRINTK_RECURSION_MASK);
> > 
> > Is it really a bug? In most cases, the message that is being printed
> > describes a bug. We just allow to print it this alternative way to
> > avoid a possible deadlock. IMHO, this might cause a confusion.
> 
> just wanted to preserve the existing behavior, but can drop it.

I see. Well, the current code drops the original message if there is a
recursion and there is no oops_in_progress. Therefore the warning
is the only way to know that a message was lost. But we store
the original message in the alternative buffer now. Therefore
it is not longer lost.

Best Regards,
Petr

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC][PATCHv2 0/7] printk: use alt_printk to handle printk() recursive calls Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2016-09-30 17:20 +0200
  [RFC][PATCHv2 7/7] printk: remove zap_locks() function Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2016-09-30 17:20 +0200
  [RFC][PATCHv2 4/7] printk: make alt_printk available when config printk set Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2016-09-30 17:20 +0200
    Re: [RFC][PATCHv2 4/7] printk: make alt_printk available when config  printk set Petr Mladek <pmladek@suse.com> - 2016-10-06 17:30 +0200
      Re: [RFC][PATCHv2 4/7] printk: make alt_printk available when config  printk set Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-10-10 03:40 +0200
  [RFC][PATCHv2 5/7] printk: use alternative printk buffers Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2016-09-30 17:20 +0200
  [RFC][PATCHv2 3/7] printk: introduce per-cpu alt_print seq buffer Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2016-09-30 17:30 +0200
    Re: [RFC][PATCHv2 3/7] printk: introduce per-cpu alt_print seq buffer Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-10-01 04:30 +0200
      Re: [RFC][PATCHv2 3/7] printk: introduce per-cpu alt_print seq buffer Petr Mladek <pmladek@suse.com> - 2016-10-06 17:00 +0200
        Re: [RFC][PATCHv2 3/7] printk: introduce per-cpu alt_print seq buffer Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-10-10 04:10 +0200
          Re: [RFC][PATCHv2 3/7] printk: introduce per-cpu alt_print seq buffer Petr Mladek <pmladek@suse.com> - 2016-10-10 13:10 +0200
    Re: [RFC][PATCHv2 3/7] printk: introduce per-cpu alt_print seq buffer Petr Mladek <pmladek@suse.com> - 2016-10-06 15:10 +0200
      Re: [RFC][PATCHv2 3/7] printk: introduce per-cpu alt_print seq buffer Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-10-10 04:00 +0200
  [RFC][PATCHv2 6/7] printk: report printk recursion from alt_printk flush Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2016-09-30 17:30 +0200
    Re: [RFC][PATCHv2 6/7] printk: report printk recursion from  alt_printk flush Petr Mladek <pmladek@suse.com> - 2016-10-06 17:50 +0200
      Re: [RFC][PATCHv2 6/7] printk: report printk recursion from  alt_printk flush Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-10-10 03:30 +0200
        Re: [RFC][PATCHv2 6/7] printk: report printk recursion from  alt_printk flush Petr Mladek <pmladek@suse.com> - 2016-10-10 13:10 +0200
  Re: [RFC][PATCHv2 0/7] printk: use alt_printk to handle printk()  recursive calls Petr Mladek <pmladek@suse.com> - 2016-10-06 18:00 +0200
    Re: [RFC][PATCHv2 0/7] printk: use alt_printk to handle printk()  recursive calls Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-10-10 03:30 +0200

csiph-web