LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: ego@in.ibm.com
Cc: Andrew Morton <akpm@linux-foundation.org>,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	LKML <linux-kernel@vger.kernel.org>,
	Oleg Nesterov <oleg@tv-sign.ru>
Subject: Re: 2.6.21-rc7-mm1: BUG_ON in kthread_bind during _cpu_down
Date: Thu, 26 Apr 2007 04:20:40 -0600	[thread overview]
Message-ID: <m1bqhbmo7b.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <20070426100922.GB12892@in.ibm.com> (Gautham R. Shenoy's message of "Thu, 26 Apr 2007 15:39:22 +0530")

Gautham R Shenoy <ego@in.ibm.com> writes:

> On Wed, Apr 25, 2007 at 04:54:10PM -0700, Andrew Morton wrote:
>> On Thu, 26 Apr 2007 01:10:21 +0200 "Rafael J. Wysocki" <rjw@sisk.pl> wrote:
>> 
>> > Hi,
>> > 
>> > The BUG_ON in khthread_bind (line 165 in kthread.c) triggers for me during
>> > attempted suspend to disk, when disable_nonboot_cpus() calls _cpu_down()
>> > (on x86_64).
>> 
> Caused due to Oleg's patch http://lkml.org/lkml/2007/4/13/93.
>
> Agreed that most of the time a kthread_create(p) is followed by a
> kthread_bind(p), in which case the assertion 
> WARN_ON(p->state != TASK_UNINTERRUPTIBLE) makes sense.
>
> But, in cpu hotplug case, we need to rebind the stop_machine_run thread
> from the cpu which has just been offlined to any online cpu.
> (kernel/cpu.c line 180)
> At this point, the thread would be in TASK_INTERRUPTIBLE waiting for us
> to call a kthread_stop on it.(kernel/kthread.c line 161)
>
> We only need to ensure in kthread_bind that the task which is being
> bound is not running or exiting. Doesn't matter if it's sleeping in 
> TASK_INTERRUPTIBLE or TASK_UNINTERRUPTIBLE state.

That will probably handle this problem.

However there is a weird interaction with process freezer.

The process freezer can come in and  wake up a kernel thread
to encourage it to call try_to_freeze_process while it is 
waiting to be bound.

How do we handle that evil race?

Eric



  parent reply	other threads:[~2007-04-26 10:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-25 23:10 Rafael J. Wysocki
2007-04-25 23:54 ` Andrew Morton
2007-04-26 10:09   ` Gautham R Shenoy
2007-04-26 10:15     ` Oleg Nesterov
2007-04-26 12:58       ` Gautham R Shenoy
2007-04-28  1:42         ` Andrew Morton
2007-05-01 18:48           ` [PATCH] add-suspend-related-notifications-for-cpu-hotplug-cleanup Oleg Nesterov
2007-05-01 22:56           ` libata-core.c: unsafe cancel_delayed_work() usage? Oleg Nesterov
2007-05-01 23:35             ` Jeff Garzik
2007-05-01 23:48               ` Oleg Nesterov
2007-05-03 21:38           ` kernel/relay.c: a strange usage of delayed_work Oleg Nesterov
2007-05-04  5:42             ` Tom Zanussi
2007-04-26 10:20     ` Eric W. Biederman [this message]
2007-04-26 20:20   ` 2.6.21-rc7-mm1: BUG_ON in kthread_bind during _cpu_down Rafael J. Wysocki

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=m1bqhbmo7b.fsf@ebiederm.dsl.xmission.com \
    --to=ebiederm@xmission.com \
    --cc=akpm@linux-foundation.org \
    --cc=ego@in.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@tv-sign.ru \
    --cc=rjw@sisk.pl \
    --subject='Re: 2.6.21-rc7-mm1: BUG_ON in kthread_bind during _cpu_down' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).