lkml.org 
[lkml]   [2010]   [May]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 2/5] stop_machine: reimplement using cpu_stop
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);
_


\
 
 \ /
  Last update: 2010-05-12 10:11    [W:0.087 / U:22.392 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site