public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Paul Gortmaker <paul.gortmaker@windriver.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [GIT PULL] printk: Support for full dynticks mode
Date: Mon, 4 Feb 2013 18:09:48 -0800	[thread overview]
Message-ID: <20130204180948.68c206c0.akpm@linux-foundation.org> (raw)
In-Reply-To: <CAFTL4hxHEknUfv0rt73Tb0YAUrypuGJArvCw4wmEPp_8PF_b0A@mail.gmail.com>

On Tue, 5 Feb 2013 02:37:54 +0100 Frederic Weisbecker <fweisbec@gmail.com> wrote:

> 2013/2/5 Andrew Morton <akpm@linux-foundation.org>:
> > On Tue,  5 Feb 2013 01:51:18 +0100
> > Frederic Weisbecker <fweisbec@gmail.com> wrote:
> >
> >>       printk: Wake up klogd using irq_work
> >
> > That seems reasonable.
> >
> > I'm wondering if we can now remove the printk_sched() special-case.
> > iirc, that was needed because wake_up(klogd) would deadlock when called
> > from sched internals.  But now that wakeup is punted to the timer tick,
> > perhaps this is now unnecessary?
> 
> I fear irq work doesn't change much the picture in this regard. Before
> irq work, printk() and printk_sched() were already relying on the tick
> (printk_tick()) to do the wake up on klogd clients. I guess that the
> deadlocks referenced by Peter were about printk() internals. May be
> logbuf_lock against some other scheduler lock?

I don't think so.  Conceptually printk() should be "inner" to the
scheduler and shouldn't call into sched things at all.  The (afaik
sole) exception to that was the klogd wakeup.

Traditionally the deadlock happened when calling printk() with
tasklist_lock (now q->lock) held.  printk() would call wake_up(klogd)
and wake_up() tries to take tasklist_lock and boom.  Moving the
wake_up() out to the tick "thread" fixed that.

Maybe there were other deadlock scenarios, dunno.  That knowledge
appears to be disappearing into the mists of time :(


  reply	other threads:[~2013-02-05  2:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-05  0:51 [GIT PULL] printk: Support for full dynticks mode Frederic Weisbecker
2013-02-05  1:20 ` Andrew Morton
2013-02-05  1:22   ` Steven Rostedt
2013-02-05  1:37   ` Frederic Weisbecker
2013-02-05  2:09     ` Andrew Morton [this message]
2013-02-05  2:42       ` Steven Rostedt
2013-02-05  4:04         ` Andrew Morton
2013-02-05 12:05           ` Ingo Molnar
2013-02-05  3:14       ` Steven Rostedt
2013-02-05  3:19         ` Frederic Weisbecker
2013-02-05  3:24           ` Steven Rostedt
2013-02-05  3:29             ` Steven Rostedt
2013-02-05 12:13 ` Ingo Molnar

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=20130204180948.68c206c0.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=paul.gortmaker@windriver.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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