[lkml]   [2005]   [May]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [Lse-tech] Re: [PATCH] cpusets+hotplug+preepmt broken
> > In particular, in my view, locks should guard data.  What data does
> > lock_cpu_hotplug() guard? I propose that it guards cpu_online_map.
> >
> > I recommend considering a different name for this lock. Perhaps
> > 'cpu_online_sem', instead of 'cpucontrol'? And perhaps the
> > lock_cpu_hotplug() should be renamed, to say 'lock_cpu_online'?
> No. CPU hotplug uses two different locking - see both lock_cpu_hotplug()
> and __stop_machine_run(). Anyone reading cpu_online_map with
> preemption disabled is safe from cpu hotplug even without taking
> any lock.

More precisely (I think), reading cpu_online_map with preemption
disabled guarantees that none of the cpus in the map will go offline
-- it does not prevent an online operation in progress (but most code
only cares about the former case). Also note that __stop_machine_run
is used only to offline a cpu.

The cpucontrol semaphore does not only protect cpu_online_map and
cpu_present_map, but also serializes cpu hotplug operations, so that
only one may be in progress at a time.

I've been mulling over submitting a Documentation/cpuhotplug.txt,
sounds like there's sufficient demand...

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-05-13 23:12    [W:0.077 / U:1.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site