Skip to content

RFC Refcount based Cpu Hotplug. V2

Gautham R Shenoy lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest5 patches 10 repliesIn review

Changes since v1 from the cover letter

- !CONFIG_HOTPLUG_CPU part is now handled correctly, thanks to the patch from Paul Jackson.

- The cpu_hotplug_begin() uses a waitqueue instead of a completion struct where a writer can wait while there are active readers in the system.

- Provided a new API's cpu_maps_update_begin(), cpu_maps_update_done() for serializing the updates to cpu_present_map and cpu_online_map. Thus threads which update the cpu_present_map should now call cpu_maps_update_begin instead of lock_cpu_hotplug(), since they play the role of writers.

- pseries_processor_add() , pseries_processor_remove() now use cpu_maps_update_begin()/cpu_maps_update_done() in place of lock_cpu_hotplug()/unlock_cpu_hotplug().

- Replaced the workqueue_mutex with workqueue_lock, which is a spinlock and guards the workqueues list.

- Updated Documentation/cpu-hotplug.txt to reflect get_online_cpus(), put_online_cpus() in place of the old lock_cpu_hotplug(), unlock_cpu_hotplug().

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5Refcount Based Cpu Hotplug implementationinclude/linux/cpu.h init/main.c kernel/cpu.c+115 -410 replies
2/5Replace lock_cpu_hotplug() with get_online_cpus()arch/i386/kernel/cpu/mtrr/main.c arch/i386/kernel/microcode.c arch/mips/kernel/mips-mt-fpaff.c +10 more+54 -540 replies
3/5Replace per-subsystem mutexes with get_online_cpus()include/linux/notifier.h kernel/cpu.c kernel/sched.c +2 more+38 -460 replies
4/5Remove CPU_DEAD/CPU_UP_CANCELLED handling from workqueue.ckernel/workqueue.c+18 -316 replies
5/5Update get_online_cpus() in Documentation/cpu-hotplug.cDocumentation/cpu-hotplug.txt+6 -50 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/5] Refcount based Cpu Hotplug. V2

Hello everyone,

This is the version 2 of the refcount based cpu-hotplug "locking" implementation.

It incorporates the review comments from the first posting which can be found here --> http://lkml.org/lkml/2007/10/16/118.

Changes since v1:
- !CONFIG_HOTPLUG_CPU part is now handled correctly, thanks to the patch from Paul Jackson.

- The cpu_hotplug_begin() uses a waitqueue instead of a completion struct where a writer can wait while there are active readers in the system.

- Provided a new API's cpu_maps_update_begin(), cpu_maps_update_done() for serializing the updates to cpu_present_map and cpu_online_map. Thus threads which update the cpu_present_map should now call cpu_maps_update_begin instead of lock_cpu_hotplug(), since they play the role of writers.

- pseries_processor_add() , pseries_processor_remove() now use cpu_maps_update_begin()/cpu_maps_update_done() in place of lock_cpu_hotplug()/unlock_cpu_hotplug().

- Replaced the workqueue_mutex with workqueue_lock, which is a spinlock and guards the workqueues list.

- Updated Documentation/cpu-hotplug.txt to reflect get_online_cpus(), put_online_cpus() in place of the old lock_cpu_hotplug(), unlock_cpu_hotplug().

I'm Cc'ing the different subsystem maintainers who might be affected by the changes in the patchstack. Especially if they rely on lock_cpu_hotplug() to provide them protection for their local data structures as well.

The patchstack which is based against 2.6.23-mm1 has behaved well when it was stress tested with kernbench running while continuously performing cpu-hotplug operations on i386, x86_64 and ppc64.

Awaiting your feedback.

Thanks and Regards
gautham.

Signature · 5 lines
Gautham R Shenoy
Linux Technology Center
IBM India.
"Freedom comes with a price tag of responsibility, which is still a bargain,
because Freedom is priceless!"