mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	"Paul E. McKenney" <paulmck@us.ibm.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Paul Gortmaker <paul.gortmaker@windriver.com>,
	Tejun Heo <tj@kernel.org>
Subject: Re: [PATCH][3.10] nohz: Fix lockup on restart from wrong error code
Date: Tue, 21 May 2013 20:09:41 -0400	[thread overview]
Message-ID: <1369181381.6828.159.camel@gandalf.local.home> (raw)
In-Reply-To: <CAFTL4hwWHqNhF3-iE+kspXO4gWFX81t8Sb30NS6UYxAO_bgG_g@mail.gmail.com>

On Tue, 2013-05-21 at 22:14 +0200, Frederic Weisbecker wrote:
> 2013/5/21 Steven Rostedt <rostedt@goodmis.org>:
> > commit a382bf934449 "nohz: Assign timekeeping duty to a CPU outside the
> > full dynticks range" added a cpu notifier callback that would prevent
> > the time keeping CPU from going offline if the have_nohz_full_mask was
> > set.
> >
> > This also prevents the CPU from going offline on system reboot.
> >
> > Worse yet, the return code was -EINVAL, but the notifier does not
> > recognize error codes, and it must be wrapped by a notifier_from_errno()
> > function. This means that even though the CPU would fail to go down, the
> > notifier would think it succeeded, and the cpu down process would
> > continue.
> >
> > This caused two different problems. One, the migration thread after
> > moving tasks from the CPU would park itself and then a task, namely the
> > reboot task, could migrate onto that CPU. Then the reboot task spins
> > waiting for the cpu to go idle. But because the reboot task happens to
> > be spinning on the cpu its waiting for, the system hangs.
> 
> Can that happen if that CPU is the boot CPU? Note this is the only
> possible timekeeper with the upstream code.

Yep it can happen in upstream (that's all I'm using). In
tick_broadcast_setup_oneshot(), it sets the tick_do_timer_cpu to the
current CPU, which can be something other than the boot CPU. Now that
CPU wont be able to be hot plugged.

> 
> >
> > The other error that happened was that the sched_domain re-setup would
> > get confused, and in get_group() the cpu = cpumask_first() would process
> > a mask that had nothing set, and return cpu > nr_cpu_ids. Later it would
> > reference the per_cpu sg with this CPU and get a bogus pointer and
> > crash.
> 
> Ouch, when are we doing this domain re-setup? I remember we
> repartition the domains after cpu down/up but I don't understand how
> that can interfere with this issue.

I haven't looked hard enough yet, but this problem only appeared when
this bug triggered. By telling the system a CPU is offline, but still
having tasks schedule to it, causes all sorts of weird side effects. I
haven't figured out in detail how this affected the sched domains, but I
don't get the sched domain corruption after fixing this bug.

-- Steve



  reply	other threads:[~2013-05-22  0:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-21 17:46 Steven Rostedt
2013-05-21 18:12 ` Frederic Weisbecker
2013-05-21 18:24   ` Steven Rostedt
2013-05-21 20:05     ` Frederic Weisbecker
2013-05-21 20:14 ` Frederic Weisbecker
2013-05-22  0:09   ` Steven Rostedt [this message]
2013-05-22 16:09     ` Frederic Weisbecker

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=1369181381.6828.159.camel@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=paul.gortmaker@windriver.com \
    --cc=paulmck@us.ibm.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    /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

all inboxes | Powered by JetHome®