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


Groups > linux.kernel > #1465042

Re: [PATCH v10 1/2] printk: Make printk() completely async

From Petr Mladek <pmladek@suse.com>
Newsgroups linux.kernel
Subject Re: [PATCH v10 1/2] printk: Make printk() completely async
Date 2016-08-18 11:40 +0200
Message-ID <s7rXP-6j1-1@gated-at.bofh.it> (permalink)
References (2 earlier) <rklDr-1IB-5@gated-at.bofh.it> <rkRWH-1G1-29@gated-at.bofh.it> <s4J4S-259-25@gated-at.bofh.it> <s5hge-8nx-19@gated-at.bofh.it> <s7lfI-1FM-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu 2016-08-18 11:27:12, Sergey Senozhatsky wrote:
> Hello,
> 
> really sorry for very long reply.
> 
> On (08/12/16 11:44), Petr Mladek wrote:
> [..]
> > IMHO, this is fine. We force the synchronous mode in critical
> > situations anyway.
> 
> yes, I think it makes sense to lower the priority (we also have
> briefly discussed this in private emails with Viresh). I'd still
> prefer to have forced sync-printk on suspend/hibernate/etc., though.

Sounds fine to me.

> > But I was curious if we could hit a printk from the wake_up_process().
> > The change above causes using the fair scheduler and there is
> > the following call chain [*]
> > 
> > I see few possible solutions:
> > 
> > 1. Replace the WARN_ONs by printk_deferred().
> > 
> >    This is the usual solution but it would make debugging less convenient.
> 
> what I did internally was a combination of #1 and #3: I introduced a
> dump_stack_deferred() function which is basically (almost) a copy-past
> of dump_stack() from lib/dump_stack.c with the difference that it calls
> printk_deferred(). and added a WARN_ON_DEFERRED() macro.
> 
> 
> > 2. Force synchronous printk inside WARN()/BUG() macros.
> 
> will it help? semaphore up() calls wake_up_process() regardless the context.
> not to mention that we still may have spin_dump() enabled.

Good point. That changes my preferences :-)

> 
> > 3. Force printk_deferred() inside WARN()/BUG() macros via the per-CPU
> >    printk_func.
> > 
> >    It might be elegant. But we do not want this outside the scheduler
> >    code. Therefore we would need special variants of  WARN_*_SCHED()
> >    BUG_*_SCHED() macros.

Also we need to make sure that everything will be done on a single CPU
as the printk_func is per-CPU variable.

> > I personally prefer the 2nd solution. What do you think about it,
> > please?
> 
> I personally think a combo of #1 and #3 is a bit better than plain #2.

I would need to see the code how it looks and if is really works.
But yes, it seems that this is the way to go.

Best Regards,
Petr

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


Thread

Re: [PATCH v10 1/2] printk: Make printk() completely async Petr Mladek <pmladek@suse.com> - 2016-08-12 11:50 +0200
  Re: [PATCH v10 1/2] printk: Make printk() completely async Vladislav Levenetz <vlevenetz@mm-sol.com> - 2016-08-15 16:40 +0200
    Re: [PATCH v10 1/2] printk: Make printk() completely async Petr Mladek <pmladek@suse.com> - 2016-08-16 11:10 +0200
  Re: [PATCH v10 1/2] printk: Make printk() completely async Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-08-18 04:30 +0200
    Re: [PATCH v10 1/2] printk: Make printk() completely async Petr Mladek <pmladek@suse.com> - 2016-08-18 11:40 +0200
      Re: [PATCH v10 1/2] printk: Make printk() completely async Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-08-18 12:00 +0200
        Re: [PATCH v10 1/2] printk: Make printk() completely async Petr Mladek <pmladek@suse.com> - 2016-08-18 13:00 +0200
          Re: [PATCH v10 1/2] printk: Make printk() completely async Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-08-19 08:40 +0200
            Re: [PATCH v10 1/2] printk: Make printk() completely async Petr Mladek <pmladek@suse.com> - 2016-08-19 12:00 +0200
              Re: [PATCH v10 1/2] printk: Make printk() completely async Jan Kara <jack@suse.cz> - 2016-08-19 21:10 +0200
                Re: [PATCH v10 1/2] printk: Make printk() completely async Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2016-08-20 07:30 +0200
                Re: [PATCH v10 1/2] printk: Make printk() completely async Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-08-22 06:20 +0200
                Re: [PATCH v10 1/2] printk: Make printk() completely async Petr Mladek <pmladek@suse.com> - 2016-08-23 14:20 +0200
                Re: [PATCH v10 1/2] printk: Make printk() completely async Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-08-24 03:40 +0200
                Re: [PATCH v10 1/2] printk: Make printk() completely async Petr Mladek <pmladek@suse.com> - 2016-08-23 15:10 +0200
                Re: [PATCH v10 1/2] printk: Make printk() completely async Petr Mladek <pmladek@suse.com> - 2016-08-23 15:50 +0200

csiph-web