From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/1 v2] ARM: only call smp_send_stop() on SMP
Date: Sat, 28 Jul 2012 11:08:31 +0100 [thread overview]
Message-ID: <20120728100831.GC7405@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20120727214024.GA10249@mudshark.cambridge.arm.com>
On Fri, Jul 27, 2012 at 10:40:24PM +0100, Will Deacon wrote:
> On Fri, Jul 27, 2012 at 10:06:37PM +0100, Russell King - ARM Linux wrote:
> > We support booting a kernel on systems with or without SMP support, even
> > with a SMP kernel. When the kernel is booted on such a system, it is
> > undefined whether smp_cross_call() is a valid function pointer.
>
> So let's define it to point at a dummy function which explodes with a BUG if
> the cpumask passed in isn't empty. That allows SMP kernels to do things like
> `cross call to all other cores' without having to worry about whether there
> are any other cores or not.
We should not be even attempting to do any cross calls when there aren't
any other CPUs in the system - that's rather the point of leaving it as
a NULL pointer so it does explode on such systems.
. the scheduler won't call smp_send_reschedule() when there are no other
CPUs in the system.
. timer ticks won't be broadcast to other CPUs if there are no other CPUs
in the system.
. function calls will not be issued to other CPUs if there are no other
CPUs in the system.
There is only one case where this doesn't happen, and that's the shutdown
path.
For instance, smp_call_function*() all check that the target CPUs are
marked online before the arch code is requested to issue an IPI to the
target CPU.
The only place which is missing this check is smp_send_stop().
Now, we could make machine_shutdown() do this instead:
if (is_smp())
smp_send_stop();
but why bother calling into smp_send_stop(), and ultimately end up with
the _only_ site which calls smp_cross_call() with an empty CPU mask when
we can avoid the call when the CPU mask is empty - and prevent this
special case of smp_cross_call() being called with an empty CPU mask
ever occuring.
next prev parent reply other threads:[~2012-07-28 10:08 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-24 10:28 [PATCH 1/1 v2] ARM: only call smp_send_stop() on SMP Javier Martinez Canillas
2012-06-25 0:51 ` Shawn Guo
2012-06-25 8:09 ` Javier Martinez Canillas
2012-06-25 8:49 ` Russell King - ARM Linux
2012-06-25 10:31 ` Javier Martinez Canillas
2012-07-27 17:15 ` Jon Hunter
2012-07-27 20:44 ` Will Deacon
2012-07-27 21:06 ` Russell King - ARM Linux
2012-07-27 21:40 ` Will Deacon
2012-07-28 10:08 ` Russell King - ARM Linux [this message]
2012-07-28 12:11 ` Will Deacon
2012-07-28 14:26 ` Javier Martinez Canillas
2012-07-29 21:31 ` Russell King - ARM Linux
2012-07-30 9:22 ` Javier Martinez Canillas
2012-07-30 14:35 ` Russell King - ARM Linux
2012-07-30 14:51 ` Javier Martinez Canillas
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=20120728100831.GC7405@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).