Skip to content

posix-timers: Rework the global hash table and provide a sane mechanism for CRIU

Thomas Gleixner lkml 3 versions – Applied

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

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest18 patches 28 repliesApplied
  2. v217 patches 24 repliesSuperseded
  3. v111 patches 7 repliesSuperseded

Changes in v3 from the cover letter

- Ensure consistency on timer_create() (new patch) - Frederic
- Pick up the lock_timer() conditional unlock fix (was V2a)
- Use proper defines in selftests
- Pick up review/ack tags

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/18posix-timers: Ensure that timer initialization is fully visiblekernel/time/posix-timers.c+14 -71 reply
2/18posix-timers: Initialise timer before adding it to the hash tablekernel/time/posix-timers.c+42 -142 replies
3/18posix-timers: Add cond_resched() to posix_timer_add() search loopkernel/time/posix-timers.c+1 -00 replies
4/18posix-timers: Cleanup includeskernel/time/posix-timers.c+10 -160 replies
5/18posix-timers: Remove a few paranoid warningskernel/time/posix-timers.c+8 -290 replies
6/18posix-timers: Remove SLAB_PANIC from kmem cachekernel/time/posix-timers.c+7 -40 replies
7/18posix-timers: Use guards in a few placeskernel/time/posix-timers.c+30 -380 replies
8/18posix-timers: Simplify lock/unlock_timer()kernel/time/posix-timers.c+29 -410 replies
9/18posix-timers: Rework timer removalinclude/linux/posix-timers.h kernel/signal.c kernel/time/posix-timers.c+90 -1132 replies
9/18posix-timers: Rework timer removalinclude/linux/posix-timers.h kernel/signal.c kernel/time/posix-timers.c+90 -1130 replies
10/18posix-timers: Make lock_timer() use guard()include/linux/cleanup.h kernel/time/posix-timers.c+51 -653 replies
11/18posix-timers: Make signal_struct:: Next_posix_timer_id an atomic_tinclude/linux/sched/signal.h kernel/time/posix-timers.c+6 -102 replies
12/18posix-timers: Improve hash table performancekernel/time/posix-timers.c+68 -311 reply
13/18posix-timers: Switch to jhash32()kernel/time/posix-timers.c+5 -50 replies
14/18posix-timers: Avoid false cacheline sharinginclude/linux/posix-timers.h kernel/time/posix-timers.c+14 -113 replies
15/18posix-timers: Make per process list RCU safekernel/time/posix-timers.c+2 -21 reply
16/18posix-timers: Dont iterate /proc/$PID/timers with sighand:: Siglock heldfs/proc/base.c+20 -282 replies
17/18posix-timers: Provide a mechanism to allocate a given timer IDinclude/linux/posix-timers.h include/linux/sched/signal.h include/uapi/linux/prctl.h +2 more+89 -264 replies
17/18posix-timers: Provide a mechanism to allocate a given timer IDinclude/linux/posix-timers.h include/linux/sched/signal.h include/uapi/linux/prctl.h +2 more+91 -266 replies
18/18selftests/timers/posix-timers: Add a test for exact allocation modetools/testing/selftests/timers/posix_timers.c+65 -10 replies
18/18selftests/timers/posix-timers: Add a test for exact allocation modetools/testing/selftests/timers/posix_timers.c+65 -11 reply

Reviews trailers per patch

20 of 21 patches have a Reviewed-by or Acked-by.

PatchFrederic WeisbeckerCyrill Gorcunov
1/18R-b
2/18R-b
3/18R-b
4/18A-b
5/18R-b
6/18R-b
7/18R-b
8/18R-b
9/18R-b R-b
9/18R-b R-b
10/18A-b
11/18R-b A-b
12/18A-b
13/18
14/18R-b
15/18R-b
16/18R-b
17/18R-b R-b T-b
17/18R-b R-b T-b
18/18R-b
18/18R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [patch V3 00/18] posix-timers: Rework the global hash table and provide a sane mechanism for CRIU

This is a follow up on V2 of this work, which can be found here:

     https://lore.kernel.org/all/[email protected]

It addresses the scalability problem of the posix timer hash and provides a performant mechanism to restore Posix timers with a given ID along with a couple of preperatory cleanups and enhancements. More details about implementation choices are in the change logs and the cover letter of V1:

     https://lore.kernel.org/all/[email protected]

Changes vs. V2:

- Ensure consistency on timer_create() (new patch) - Frederic
- Pick up the lock_timer() conditional unlock fix (was V2a)
- Use proper defines in selftests
- Pick up review/ack tags

The series survives all posix timer tests and did not show any regressions so far.

The series is based on:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip timers/core

and is also available from git:

git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git timers/posix

Thanks,

tglx
---
Eric Dumazet (3):
posix-timers: Initialise timer before adding it to the hash table
posix-timers: Add cond_resched() to posix_timer_add() search loop
posix-timers: Make signal_struct:: Next_posix_timer_id an atomic_t

Peter Zijlstra (1):
posix-timers: Make lock_timer() use guard()

Thomas Gleixner (14):
posix-timers: Ensure that timer initialization is fully visible
posix-timers: Cleanup includes
posix-timers: Remove a few paranoid warnings
posix-timers: Remove SLAB_PANIC from kmem cache
posix-timers: Use guards in a few places
posix-timers: Simplify lock/unlock_timer()
posix-timers: Rework timer removal
posix-timers: Improve hash table performance
posix-timers: Switch to jhash32()
posix-timers: Avoid false cacheline sharing
posix-timers: Make per process list RCU safe
posix-timers: Dont iterate /proc/$PID/timers with sighand:: Siglock held
posix-timers: Provide a mechanism to allocate a given timer ID selftests/timers/posix-timers: Add a test for exact allocation mode

 fs/proc/base.c                                |   48 --
 include/linux/cleanup.h                       |   22 -
 include/linux/posix-timers.h                  |   30 +
 include/linux/sched/signal.h                  |    3 
 include/uapi/linux/prctl.h                    |   10 
 kernel/signal.c                               |    2 
 kernel/sys.c                                  |    5 
 kernel/time/posix-timers.c                    |  540 +++++++++++++-------------
 tools/testing/selftests/timers/posix_timers.c |   66 +++
 9 files changed, 418 insertions(+), 308 deletions(-)