public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Stephen Warren <swarren@nvidia.com>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Will Deacon <will.deacon@arm.com>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>,
	"kexec@lists.infradead.org" <kexec@lists.infradead.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ARM: call disable_nonboot_cpus() from machine_shutdown()
Date: Tue, 29 Jan 2013 15:10:42 -0700	[thread overview]
Message-ID: <510848E2.50203@wwwdotorg.org> (raw)
In-Reply-To: <87obgwb5d1.fsf@xmission.com>

On 01/10/2013 11:28 PM, Eric W. Biederman wrote:
...
> I don't have any problem with generic code in the reboot path
> doing:
> if (cpu_online(0))
> 	set_cpus_allowed_ptr(current, cpumask_of(0));

It looks like that API just affects the scheduler, and not whether the
other CPUs are actually active/hot-plugged-in. At least for my use-case,
I need something that really disables the other CPUs so they aren't
executing code, hence my tendency to hot-un-plug them using
disable_nonboot_cpus(), rather than just shift task execution off them
using the code above.

I wonder if all architectures shouldn't always do the following in all
reboot/shutdown/kexec cases:

* set_cpus_allowed_ptr() to limit code execution to a single CPU.
* disable_nonboot_cpus() (or equivalent) if it's available to turn off
all the other CPUs.

The issue here would be that disable_nonboot_cpus() isn't always
available; I assume that's part of the reason that there are
arch-specific machine_xxx() hooks, so that architectures can
power-off/reset their CPUs even when hotplug isn't enabled? I wonder if
that can be refactored so that reboot/poweroff/kexec can share some
CPU-disable code with CPU hotplug?

      parent reply	other threads:[~2013-01-29 22:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1357160861-26282-1-git-send-email-swarren@wwwdotorg.org>
     [not found] ` <50E4C9C6.20609@codeaurora.org>
     [not found]   ` <20130103120259.GB5193@mudshark.cambridge.arm.com>
     [not found]     ` <20130103122100.GN2631@n2100.arm.linux.org.uk>
     [not found]       ` <50E5E967.3020805@wwwdotorg.org>
     [not found]         ` <20130106162200.GC11025@mudshark.cambridge.arm.com>
     [not found]           ` <20130106164033.GA3222@n2100.arm.linux.org.uk>
     [not found]             ` <87ehhxahd1.fsf@xmission.com>
     [not found]               ` <20130107144812.GD3222@n2100.arm.linux.org.uk>
     [not found]                 ` <87d2xcfeew.fsf@xmission.com>
2013-01-29 22:01                   ` [PATCH] ARM: call disable_nonboot_cpus() from machine_shutdown() Stephen Warren
     [not found]               ` <50ECB49C.7010609@wwwdotorg.org>
     [not found]                 ` <87obgwb5d1.fsf@xmission.com>
2013-01-29 22:10                   ` Stephen Warren [this message]

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=510848E2.50203@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --cc=ebiederm@xmission.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=sboyd@codeaurora.org \
    --cc=swarren@nvidia.com \
    --cc=will.deacon@arm.com \
    /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