All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Bohan <mbohan@codeaurora.org>
To: Santosh Shilimkar <santosh.shilimkar@ti.com>
Cc: Kevin Cernekee <cernekee@gmail.com>,
	mingo@elte.hu, akpm@linux-foundation.org,
	simon.kagstrom@netinsight.net, David.Woodhouse@intel.com,
	lethal@linux-sh.org, tj@kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-msm@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: console_cpu_notify can cause scheduling BUG during CPU hotplug
Date: Tue, 26 Apr 2011 14:06:28 -0700	[thread overview]
Message-ID: <4DB733D4.3000002@codeaurora.org> (raw)
In-Reply-To: <4DB65EEC.7060604@ti.com>

On 4/25/2011 10:58 PM, Santosh Shilimkar wrote:
> On 4/26/2011 5:48 AM, Kevin Cernekee wrote:
>> On Mon, Apr 25, 2011 at 4:33 PM, Michael Bohan<mbohan@codeaurora.org>
>> wrote:
>>> I was curious if this scenario was accounted for in the design of the
>>> console CPU notifier. One workaround for this problem is to remove
>>> CPU_DEAD
>>> from the possible actions in console_cpu_notify(). In fact, v1-v4 of the
>>> patch above did not have CPU_DEAD, CPU_DYING or CPU_DOWN_FAILED in
>>> the list
>>> of actions. I wasn't able to track down why the other cases were
>>> added in
>>> the final patch.
>>
>> Here is the background information on the CPU_{DEAD,DYING,DOWN_FAILED}
>> cases:
>>
>> http://lkml.org/lkml/2010/6/29/65
> That's right.
> May be the change log for commit '034260d67' would have been
> bit more descriptive about the CPU hot-plug events.

Thanks for the clarification. Now regarding the problem, it seems like 
we can't be taking a semaphore in that path. That is to say, we can't be 
calling console_lock from within stop_machine. A few options that come 
to mind:

-Use console_trylock and accept the possibility that the output is not 
guaranteed to be synchronous with the hotplug operation.
-Defer the console output emission (eg. workqueue) during hotplug.
-Hybrid of the two: if the console_trylock fails, then we defer the 
console output emission.

Any opinions? I can submit a patch if one of these approaches is reasonable.

Thanks,
Mike

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum

WARNING: multiple messages have this Message-ID (diff)
From: mbohan@codeaurora.org (Michael Bohan)
To: linux-arm-kernel@lists.infradead.org
Subject: console_cpu_notify can cause scheduling BUG during CPU hotplug
Date: Tue, 26 Apr 2011 14:06:28 -0700	[thread overview]
Message-ID: <4DB733D4.3000002@codeaurora.org> (raw)
In-Reply-To: <4DB65EEC.7060604@ti.com>

On 4/25/2011 10:58 PM, Santosh Shilimkar wrote:
> On 4/26/2011 5:48 AM, Kevin Cernekee wrote:
>> On Mon, Apr 25, 2011 at 4:33 PM, Michael Bohan<mbohan@codeaurora.org>
>> wrote:
>>> I was curious if this scenario was accounted for in the design of the
>>> console CPU notifier. One workaround for this problem is to remove
>>> CPU_DEAD
>>> from the possible actions in console_cpu_notify(). In fact, v1-v4 of the
>>> patch above did not have CPU_DEAD, CPU_DYING or CPU_DOWN_FAILED in
>>> the list
>>> of actions. I wasn't able to track down why the other cases were
>>> added in
>>> the final patch.
>>
>> Here is the background information on the CPU_{DEAD,DYING,DOWN_FAILED}
>> cases:
>>
>> http://lkml.org/lkml/2010/6/29/65
> That's right.
> May be the change log for commit '034260d67' would have been
> bit more descriptive about the CPU hot-plug events.

Thanks for the clarification. Now regarding the problem, it seems like 
we can't be taking a semaphore in that path. That is to say, we can't be 
calling console_lock from within stop_machine. A few options that come 
to mind:

-Use console_trylock and accept the possibility that the output is not 
guaranteed to be synchronous with the hotplug operation.
-Defer the console output emission (eg. workqueue) during hotplug.
-Hybrid of the two: if the console_trylock fails, then we defer the 
console output emission.

Any opinions? I can submit a patch if one of these approaches is reasonable.

Thanks,
Mike

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum

  reply	other threads:[~2011-04-26 21:06 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-25 23:33 console_cpu_notify can cause scheduling BUG during CPU hotplug Michael Bohan
2011-04-25 23:33 ` Michael Bohan
2011-04-25 23:33 ` Michael Bohan
2011-04-26  0:18 ` Kevin Cernekee
2011-04-26  0:18   ` Kevin Cernekee
2011-04-26  5:58   ` Santosh Shilimkar
2011-04-26  5:58     ` Santosh Shilimkar
2011-04-26  5:58     ` Santosh Shilimkar
2011-04-26 21:06     ` Michael Bohan [this message]
2011-04-26 21:06       ` Michael Bohan
2011-04-27  7:38       ` Borislav Petkov
2011-04-27  7:38         ` Borislav Petkov
2011-04-27 22:12         ` Michael Bohan
2011-04-27 22:12           ` Michael Bohan
2011-04-27 22:12           ` Michael Bohan
2011-04-30  8:38           ` Borislav Petkov
2011-04-30  8:38             ` Borislav Petkov
2011-05-09 20:39             ` Michael Bohan
2011-05-09 20:39               ` Michael Bohan
2011-05-09 20:39               ` Michael Bohan
  -- strict thread matches above, loose matches on Subject: below --
2011-08-30  8:37 Shen Canquan
2011-09-05  8:34 ` canquan.shen

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=4DB733D4.3000002@codeaurora.org \
    --to=mbohan@codeaurora.org \
    --cc=David.Woodhouse@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=cernekee@gmail.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=santosh.shilimkar@ti.com \
    --cc=simon.kagstrom@netinsight.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.