Skip to content

Make life miserable for split lockers

Tony Luck linux-patches lkml 2 versions – Applied

Status from this message: The following commit has been merged into the x86/splitlock branch of tip:

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 6 repliesApplied
  2. v11 patch 4 repliesSuperseded

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/2x86/split_lock: Make life miserable for split lockersarch/x86/kernel/cpu/intel.c include/linux/sched.h kernel/fork.c+63 -106 replies
2/2x86/split-lock: Remove unused TIF_SLD bitarch/x86/include/asm/cpu.h arch/x86/include/asm/thread_info.h arch/x86/kernel/cpu/intel.c +1 more+1 -200 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/2] Make life miserable for split lockers

See part 0001 commit message for what & why.

Changes since v1(RFC) based on feedback from Thomas:

1) No longer implemented as new sub-option of split_lock_detect boot option. Just update the existing (default) "warn" mode.
2) Use the (more appropriate) "schedule_delayed_work_on() instead of schedule_delayed_work() to re-enable split lock detection.
3) Add msleep for extra misery before disabling split lock detection on a core.

Next two aren't from Thomas.
4) Drop the TIF_SLD bit and associated code. No longer needed. This part is done as clean up in patch 0002.
5) Add a bit in task structure to make sure each split-locking task only tries to print a warn message to the console once. Need this to preserve existing behavior that was previously controlled by the TIF_SLD bit.

Testing notes. I checked this out by running 2,000 processes that each looped executing 10,000 split locks. System remains very responsive while this test is running (compared with unusable without these patches). When each process gets the semaphore and two jiffies of time to execute split locks it manages to complete ~430 before the delayed work thread re-enables detection.

The semaphore gives nice round-robin access to the 2,000 tasks. So each ends up blocking for 24ish seconds while the other 1,999 task take their turn.

Tony Luck (2):
x86/split_lock: Make life miserable for split lockers x86/split-lock: Remove unused TIF_SLD bit

 arch/x86/include/asm/cpu.h         |  2 -
 arch/x86/include/asm/thread_info.h |  4 +-
 arch/x86/kernel/cpu/intel.c        | 77 +++++++++++++++++++++---------
 arch/x86/kernel/process.c          |  3 --
 include/linux/sched.h              |  3 ++
 kernel/fork.c                      |  5 ++
 6 files changed, 64 insertions(+), 30 deletions(-)
Signature · 1 line
2.35.1