From: Andrew Morton <akpm@linux-foundation.org>
To: Tejun Heo <tj@kernel.org>
Cc: mingo@elte.hu, peterz@infradead.org,
linux-kernel@vger.kernel.org, paulmck@linux.vnet.ibm.com,
Oleg Nesterov <oleg@redhat.com>,
Dimitri Sivanich <sivanich@sgi.com>
Subject: Re: [PATCH 2/5] stop_machine: reimplement using cpu_stop
Date: Tue, 11 May 2010 14:50:59 -0700 [thread overview]
Message-ID: <20100511145059.d846e85c.akpm@linux-foundation.org> (raw)
In-Reply-To: <1273164772-19149-3-git-send-email-tj@kernel.org>
On Thu, 6 May 2010 18:52:49 +0200
Tejun Heo <tj@kernel.org> wrote:
> Reimplement stop_machine using cpu_stop. As cpu stoppers are
> guaranteed to be available for all online cpus,
> stop_machine_create/destroy() are no longer necessary and removed.
>
> With resource management and synchronization handled by cpu_stop, the
> new implementation is much simpler. Asking the cpu_stop to execute
> the stop_cpu() state machine on all online cpus with cpu hotplug
> disabled is enough.
>
> stop_machine itself doesn't need to manage any global resources
> anymore, so all per-instance information is rolled into struct
> stop_machine_data and the mutex and all static data variables are
> removed.
>
> The previous implementation created and destroyed RT workqueues as
> necessary which made stop_machine() calls highly expensive on very
> large machines. According to Dimitri Sivanich, preventing the dynamic
> creation/destruction makes booting faster more than twice on very
> large machines. cpu_stop resources are preallocated for all online
> cpus and should have the same effect.
>
> ...
>
> @@ -361,9 +357,6 @@ int disable_nonboot_cpus(void)
> {
> int cpu, first_cpu, error;
>
> - error = stop_machine_create();
> - if (error)
> - return error;
> cpu_maps_update_begin();
> first_cpu = cpumask_first(cpu_online_mask);
> /*
kernel/cpu.c: In function 'disable_nonboot_cpus':
kernel/cpu.c:397: warning: 'error' may be used uninitialized in this function
Looks like this is a real bug if the cpumask happens to contain only a
single CPU for some reason.
--- a/kernel/cpu.c~a
+++ a/kernel/cpu.c
@@ -355,7 +355,8 @@ static cpumask_var_t frozen_cpus;
int disable_nonboot_cpus(void)
{
- int cpu, first_cpu, error;
+ int cpu, first_cpu;
+ int error = 0;
cpu_maps_update_begin();
first_cpu = cpumask_first(cpu_online_mask);
_
next prev parent reply other threads:[~2010-05-11 21:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-06 16:52 [GIT PULL sched/core] cpu_stop: implement and use cpu_stop, take#3 Tejun Heo
2010-05-06 16:52 ` [PATCH 1/5] cpu_stop: implement stop_cpu[s]() Tejun Heo
2010-05-06 16:52 ` [PATCH 2/5] stop_machine: reimplement using cpu_stop Tejun Heo
2010-05-11 21:50 ` Andrew Morton [this message]
2010-05-12 7:20 ` Tejun Heo
2010-05-06 16:52 ` [PATCH 3/5] sched: replace migration_thread with cpu_stop Tejun Heo
2010-05-06 19:29 ` Paul E. McKenney
2010-05-07 5:24 ` Tejun Heo
2010-05-06 16:52 ` [PATCH 4/5] sched: kill paranoia check in synchronize_sched_expedited() Tejun Heo
2010-05-06 16:52 ` [PATCH 5/5] sched: correctly place paranioa memory barriers " Tejun Heo
2010-05-08 11:15 ` [GIT PULL sched/core] cpu_stop: implement and use cpu_stop, take#3 Ingo Molnar
2010-05-08 12:47 ` Tejun Heo
2010-05-08 15:17 ` [PATCH] cpu_stop: add dummy implementation for UP Tejun Heo
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=20100511145059.d846e85c.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=oleg@redhat.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=sivanich@sgi.com \
--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;
as well as URLs for NNTP newsgroup(s).