Messages in this thread | | | Date | Tue, 09 Mar 2010 08:22:59 +0900 | From | Tejun Heo <> | Subject | Re: [PATCH 2/4] stop_machine: reimplement using cpuhog |
| |
Hello,
On 03/09/2010 04:06 AM, Oleg Nesterov wrote: > On 03/09, Tejun Heo wrote: >> >> int __stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus) >> { >> ... >> + /* Set the initial state and hog all online cpus. */ >> + set_state(&smdata, STOPMACHINE_PREPARE); >> + return hog_cpus(cpu_online_mask, stop_cpu, &smdata); >> } > > Could you please confirm this is correct? > > I am not sure I understand how the code looks with the patch applied, > but the lockless set_state() above can confuse another stop_machine() > in progress?
set_state() now modifies smdata->state and smdata is now local variable of __stop_machine(). stop_machine instances don't have any shared resource anymore. Synchronization and resource sharing are all cpuhog's responsibilities.
Thanks.
-- tejun
| |