Skip to content

stop_machine: cleanups, fix, remove lglock

Oleg Nesterov lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest6 patches 8 repliesIn review
  2. v15 patches 4 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6stop_machine: move cpu_stopper_task and stop_cpus_work into struct cpu_stopperkernel/stop_machine.c+9 -80 replies
2/6stop_machine: don't do for_each_cpu() twice in queue_stop_cpus_work()kernel/stop_machine.c+7 -100 replies
3/6stop_machine: unexport __stop_machine()include/linux/stop_machine.h kernel/cpu.c kernel/stop_machine.c+4 -220 replies
4/6stop_machine: use cpu_stop_fn_t where possibleinclude/linux/stop_machine.h kernel/stop_machine.c+8 -80 replies
5/6stop_machine: cpu_stop_park() should remove cpu_stop_work's from listkernel/stop_machine.c+4 -20 replies
6/6stop_machine: kill stop_cpus_lock and lg_double_lock/unlock()include/linux/lglock.h kernel/locking/lglock.c kernel/stop_machine.c+71 -767 replies

Reviews trailers per patch

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

Read the v2 thread

Cover letter [PATCH v2 0/6] stop_machine: cleanups, fix, remove lglock

Hello,

Let me resend this. The only change in v2 is that I rediffed this series against v4.2-rc3.

5/6 patch fixes the bug, I think. Say, stop_one_cpu(X) can race with _cpu_down(X)->stop_machine() so that the kernel will crash if this CPU X becomes online again. The window after cpu_stopper_thread() returns and before smpboot_thread() calls ->park() is tiny, but still this is possible afaics. But see the changelog in 6/6, I think we should turn this cpu_stop_signal_done() into BUG() later.

6/6 removes lglock from kernel/stop_machine.c.

Peter, Rik, what do you think ?

Oleg.

 include/linux/lglock.h       |    5 --
 include/linux/stop_machine.h |   28 ++------
 kernel/cpu.c                 |    2 +-
 kernel/locking/lglock.c      |   22 ------
 kernel/stop_machine.c        |  162 ++++++++++++++++++++++++------------------
 5 files changed, 98 insertions(+), 121 deletions(-)