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


Groups > linux.kernel > #1571696

Re: [PATCHv7 6/8] printk: use printk_safe buffers in printk

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCHv7 6/8] printk: use printk_safe buffers in printk
Date 2017-02-01 17:20 +0100
Message-ID <t65Nx-8ap-31@gated-at.bofh.it> (permalink)
References (1 earlier) <sT0LE-36Q-29@gated-at.bofh.it> <t5Kzn-3vy-11@gated-at.bofh.it> <t5Z5o-3VC-25@gated-at.bofh.it> <t5Zyr-4a5-41@gated-at.bofh.it> <t65aO-7Hf-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Feb 01, 2017 at 04:39:10PM +0100, Petr Mladek wrote:
> I guess that you are talking about the introduction of
> #define SCHED_WARN_ON(x)	WARN_ONCE(x, #x)

No, there's a lot of regular WARN/WARN_ON/etc.. usage in the scheduler.
That thing was just a convenience wapper to print the condition that
warned.

> It reduces the risk of the deadlock but some risk is still there.
> IMHO, it does not avoid the lockdep warning.

It doesn't reduce anything, nor did it ever try. I really don't care if
it occasionally deadlocks, as long as it mostly gets out.

> One solution would be to hide the occasional deadlock and disable
> lockdep in SCHED_WARN_ON():
> 
> #define SCHED_WARN_ON(x)				\
> ({							\
> 	int __ret_sched_warn_on;			\
> 	lockdep_off();					\
> 	__ret_sched_warn_on = WARN_ONCE(x, #x);		\
> 	lockdep_on();					\
> 	unlikely(__ret_sched_warn_on);			\
> })

Like said, there's plenty of regular WARN/WARN_ON usage, so this will
not help much.

> Another solution would be to redirect it into the
> alternative buffer and let it printed later:
> 
> #define SCHED_WARN_ON(x)	WARN_ONCE(x, #x)		\
> ({								\
> 	unsigned long __sched_warn_on_flags;			\
> 	printk_safe_enter_irqsave(__sched_warn_on_flags);	\
> 	__ret_sched_warn_on = WARN_ONCE(x, #x);			\
> 	printk_safe_exit_irqrestore(__sched_warn_on_flags);	\
> 	unlikely(__ret_sched_warn_on);				\
> })

So my kernel doesn't yet have that abomination; that redirects it to a
buffer for later printing right? I hope that buffer is big enough to
hold a full WARN splat and the machine lives long enough to make it to
printing that crap.

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


Thread

Re: [PATCHv7 6/8] printk: use printk_safe buffers in printk Ross Zwisler <zwisler@gmail.com> - 2017-01-31 18:40 +0100
  Re: [PATCHv7 6/8] printk: use printk_safe buffers in printk Jan Kara <jack@suse.cz> - 2017-02-01 10:10 +0100
    Re: [PATCHv7 6/8] printk: use printk_safe buffers in printk Peter Zijlstra <peterz@infradead.org> - 2017-02-01 10:40 +0100
      Re: [PATCHv7 6/8] printk: use printk_safe buffers in printk Petr Mladek <pmladek@suse.com> - 2017-02-01 16:40 +0100
        Re: [PATCHv7 6/8] printk: use printk_safe buffers in printk Peter Zijlstra <peterz@infradead.org> - 2017-02-01 17:20 +0100
          Re: [PATCHv7 6/8] printk: use printk_safe buffers in printk Steven Rostedt <rostedt@goodmis.org> - 2017-02-01 17:50 +0100
        Re: [PATCHv7 6/8] printk: use printk_safe buffers in printk Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-02-02 03:20 +0100
          Re: [PATCHv7 6/8] printk: use printk_safe buffers in printk Peter Zijlstra <peterz@infradead.org> - 2017-02-02 10:10 +0100
            Re: [PATCHv7 6/8] printk: use printk_safe buffers in printk Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-02-02 11:10 +0100
              Re: [PATCHv7 6/8] printk: use printk_safe buffers in printk Petr Mladek <pmladek@suse.com> - 2017-02-02 16:30 +0100
                Re: [PATCHv7 6/8] printk: use printk_safe buffers in printk Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-02-03 03:50 +0100
  Re: [PATCHv7 6/8] printk: use printk_safe buffers in printk Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-02-02 03:00 +0100

csiph-web