Skip to content

futex: Add support for process private hashing

Thomas Gleixner lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest posting 2/27 patches 33 repliesIn review
  2. v2 posting 1/27 patches 0 repliesSuperseded
  3. v17 patches 13 repliesSuperseded

Patches in v2 posting 2/2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7futex: Add some more function commentrykernel/futex.c+12 -31 reply
2/7futex: Hash private futexes per processinclude/linux/futex.h include/linux/futex_types.h include/linux/mm_types.h +3 more+212 -1119 replies
3/7futex: Add op for hash preallocationinclude/uapi/linux/futex.h kernel/futex.c+42 -011 replies
4/7futex: Add sysctl knobs for process private hashDocumentation/sysctl/kernel.txt include/linux/futex.h kernel/futex.c +1 more+42 -22 replies
5/7perf/bench/futex-hash: Support NUMAtools/perf/bench/Build tools/perf/bench/futex-hash.c+82 -110 replies
6/7perf/bench/futex-hash: Support preallocate hash tabletools/perf/bench/futex-hash.c tools/perf/bench/futex.h+19 -20 replies
7/7futex.2: Document hash preallocation opcodeman2/futex.2+40 -00 replies

Reviews trailers per patch

1 of 7 patches has a Reviewed-by or Acked-by.

PatchDarren Hart
1/7R-b
2/7
3/7
4/7
5/7
6/7
7/7

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

Read the v2 thread

Cover letter [patch V2 0/7] futex: Add support for process private hashing

The standard futex mechanism in the Linux kernel uses a global hash to store transient state. Collisions on that hash can lead to performance degradation and on real-time enabled kernels to unbound priority inversions.

This new attempt to solve the issue does not require user space changes and operates transparently. On the first futex operation of a process the kernel allocates a hash private to the process. All process private futexes are hashed in this hash. Process shared futexes still use the global hash.

For RT applications and pathological use cases a new futex op is provided which allows the application to preallocate and thereby size the process private hash.

The last two patches add support to the perf futex-hash benchmark so test can be run on nodes and the preallocation sizing can be tested.

The last patch contains a first update for the futex man page.

The difference vs. V1 of this series is that it uses hash_long() now that the hash_64 implementation has been fixed in mainline. The performance numbers are more or less the same as with V1 [1].

Thanks,

tglx

[1] http://lkml.kernel.org/r/[email protected]

----

 Documentation/sysctl/kernel.txt |   17 +++
 b/include/linux/futex_types.h   |   12 ++
 include/linux/futex.h           |   39 +++++--
 include/linux/mm_types.h        |    4 
 include/uapi/linux/futex.h      |    1 
 init/Kconfig                    |    4 
 kernel/fork.c                   |    3 
 kernel/futex.c                  |  215 +++++++++++++++++++++++++++++++++++++++-
 kernel/sysctl.c                 |   21 +++
 tools/perf/bench/Build          |    4 
 tools/perf/bench/futex-hash.c   |  101 ++++++++++++++++--
 tools/perf/bench/futex.h        |    5 
 12 files changed, 403 insertions(+), 23 deletions(-)