RFC stop_machine: kill stop_cpus_mutex and stop_cpus_lock
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest6 patches 9 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | stop_machine: move cpu_stopper_task and stop_cpus_work into struct cpu_stopperkernel/ | +9 | 0 replies | |
| 2/6 | stop_machine: don't do for_each_cpu() twice in queue_stop_cpus_work()kernel/ | +7 | 0 replies | |
| 3/6 | stop_machine: introduce stop_work_alloc() and stop_work_free()kernel/ | +50 | 0 replies | |
| 4/6 | stop_machine: kill stop_cpus_mutexkernel/ | +6 | 0 replies | |
| 5/6 | stop_machine: change stop_two_cpus() just use stop_cpu(), kill lg_double_lock/unlockinclude/ kernel/ kernel/ | +11 | 0 replies | |
| 6/6 | stop_machine: optimize stop_work_alloc()kernel/ | +43 | 1 reply |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [RFC PATCH 0/6] stop_machine: kill stop_cpus_mutex and stop_cpus_lock
Quoted 15 lines · Peter Zijlstra
Quoted 13 lines · Oleg Nesterov
lock_stop_cpus_works(cpumask) { for_each_cpu(cpu, cpumask) mutex_lock(per_cpu(cpu_stopper_task, cpu).work_mutex); } unlock_stop_cpus_works(cpumask) { for_each_cpu(cpu, cpumask) mutex_lock(...); }
Quoted 4 lines
Quoted 2 lines
which should be used instead of
stop_cpus_mutex. After this changestop_two_cpus()can just usestop_cpus().Right, lockdep annotating that will be 'interesting' though.
Sure, and this is too inefficient, this is only to explain what I mean.
How about this series? Untested. For review.
Quoted 2 lines
And
stop_two_cpus()then has the problem of allocating a cpumask.
Yes, but we can avoid this, see the changelog in 5/6.
Quoted 2 lines
Simpler to
let it keep 'abuse' the queueing spinlock in there.
Not sure.
And note that this series kills stop_cpus_mutex, so that multiple stop_cpus()'s / stop_machine()'s can run in parallel if cpumask's do not overlap.
Note also the changelog in 6/6, we can simplify + optimize this code a bit more.
What do you think?
Oleg.
include/linux/lglock.h | 5 - kernel/locking/lglock.c | 22 ----- kernel/stop_machine.c | 197 ++++++++++++++++++++++++++++------------------- 3 files changed, 119 insertions(+), 105 deletions(-)