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


Groups > linux.kernel > #1357041

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

From Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Newsgroups linux.kernel
Subject Re: [RFC][PATCH v3 1/2] printk: Make printk() completely async
Date 2016-03-14 09:20 +0100
Message-ID <rcvTj-1bk-1@gated-at.bofh.it> (permalink)
References <rcepr-6oC-9@gated-at.bofh.it> <rceps-6oC-15@gated-at.bofh.it> <rcuXg-yJ-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On (03/14/16 08:11), Jan Kara wrote:
[..]
> > +	if (!sync_print) {
> > +		if (printk_thread && !in_panic) {
> > +			/*
> > +			 * Wakeup the printing kthread and offload printing
> > +			 * to a schedulable context.
> > +			 */
> > +			wake_up(&printing_wait);
> > +		} else if (in_sched) {
> > +			/*
> > +			 * @in_sched messages may come too early, when we don't
> > +			 * yet have @printk_thread. We can't print deferred
> > +			 * messages directly, because this may deadlock, route
> > +			 * them via IRQ context.
> > +			 */
> > +			__this_cpu_or(printk_pending,
> > +					PRINTK_PENDING_OUTPUT);
> > +			irq_work_queue(this_cpu_ptr(&wake_up_klogd_work));
> 
> You cannot call wake_up() from a scheduler context - i.e., if in_sched is
> true, you have to use irq work unconditionally. You can wake up kthread
> from irq work or just directly print the message there. Otherwise the patch
> looks fine.

oh, thanks for catching this! you are right.

	-ss

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


Thread

[RFC][PATCH v3 0/2] printk: Make printk() completely async Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2016-03-13 14:40 +0100
  [RFC][PATCH v3 2/2] printk: Skip messages on oops Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2016-03-13 14:40 +0100
  [RFC][PATCH v3 1/2] printk: Make printk() completely async Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2016-03-13 14:40 +0100
    Re: [RFC][PATCH v3 1/2] printk: Make printk() completely async Jan Kara <jack@suse.cz> - 2016-03-14 08:20 +0100
      Re: [RFC][PATCH v3 1/2] printk: Make printk() completely async Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-03-14 09:20 +0100

csiph-web