linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch V2 0/7] futex: Add support for process private hashing
@ 2016-05-05 20:44 Thomas Gleixner
  2016-05-05 20:44 ` [patch V2 1/7] futex: Add some more function commentry Thomas Gleixner
                   ` (6 more replies)
  0 siblings, 7 replies; 42+ messages in thread
From: Thomas Gleixner @ 2016-05-05 20:44 UTC (permalink / raw)
  To: LKML
  Cc: Sebastian Andrzej Siewior, Linus Torvalds, Darren Hart,
	Peter Zijlstra, Ingo Molnar, Michael Kerrisk, Davidlohr Bueso,
	Chris Mason, Carlos O'Donell, Torvald Riegel, Eric Dumazet

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/20160428161742.363543816@linutronix.de

----
 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(-)

^ permalink raw reply	[flat|nested] 42+ messages in thread
* [patch V2 0/7] Sebastian Andrzej Siewior <bigeasy@linutronix.de>, Linus Torvalds <torvalds@linux-foundation.org>, Darren Hart <darren@dvhart.com>, Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@kernel.org>, Michael Kerrisk <mtk.manpages@googlemail.com>, Davidlohr Bueso <dave@stgolabs.net>, Chris Mason <clm@fb.com>, Carlos O'Donell <carlos@redhat.com>, Torvald Riegel <triegel@redhat.com>, Eric Dumazet <edumazet@google.com>
@ 2016-05-05 19:03 Thomas Gleixner
  2016-05-05 19:03 ` [patch V2 2/7] futex: Hash private futexes per process Thomas Gleixner
  0 siblings, 1 reply; 42+ messages in thread
From: Thomas Gleixner @ 2016-05-05 19:03 UTC (permalink / raw)
  To: LKML

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/20160428161742.363543816@linutronix.de

----
 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(-)

^ permalink raw reply	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2016-05-30 14:02 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-05 20:44 [patch V2 0/7] futex: Add support for process private hashing Thomas Gleixner
2016-05-05 20:44 ` [patch V2 1/7] futex: Add some more function commentry Thomas Gleixner
2016-05-06 17:37   ` Darren Hart
2016-05-05 20:44 ` [patch V2 2/7] futex: Hash private futexes per process Thomas Gleixner
2016-05-06 18:09   ` Darren Hart
2016-05-06 21:56     ` Darren Hart
2016-05-07  8:45       ` Thomas Gleixner
2016-05-11 21:08         ` Darren Hart
2016-05-07  8:44     ` Thomas Gleixner
2016-05-11 21:07       ` Darren Hart
2016-05-27 16:36       ` Sebastian Andrzej Siewior
2016-05-19 12:21   ` Peter Zijlstra
2016-05-27 16:52     ` Sebastian Andrzej Siewior
2016-05-30  8:43       ` Peter Zijlstra
2016-05-19 12:24   ` Peter Zijlstra
2016-05-27 17:10     ` Sebastian Andrzej Siewior
2016-05-30  8:58       ` Peter Zijlstra
2016-05-30 11:08         ` Sebastian Andrzej Siewior
2016-05-30 12:06           ` Peter Zijlstra
2016-05-30 13:37             ` Sebastian Andrzej Siewior
2016-05-30 13:49               ` Peter Zijlstra
2016-05-30 13:59                 ` Sebastian Andrzej Siewior
2016-05-30 14:02                   ` Peter Zijlstra
2016-05-05 20:44 ` [patch V2 4/7] futex: Add sysctl knobs for process private hash Thomas Gleixner
2016-05-06 18:22   ` Darren Hart
2016-05-27 17:33     ` Sebastian Andrzej Siewior
2016-05-05 20:44 ` [patch V2 3/7] futex: Add op for hash preallocation Thomas Gleixner
2016-05-06 18:18   ` Darren Hart
2016-05-07  8:47     ` Thomas Gleixner
2016-05-07 11:40       ` Thomas Gleixner
2016-05-19 12:28       ` Peter Zijlstra
2016-05-19 19:36         ` Darren Hart
2016-05-19 12:24   ` Peter Zijlstra
2016-05-19 19:38     ` Darren Hart
2016-05-20  4:50       ` Peter Zijlstra
2016-05-19 12:25   ` Peter Zijlstra
2016-05-27 17:27     ` Sebastian Andrzej Siewior
2016-05-30  8:59       ` Peter Zijlstra
2016-05-05 20:44 ` [patch V2 5/7] perf/bench/futex-hash: Support NUMA Thomas Gleixner
2016-05-05 20:44 ` [patch V2 6/7] perf/bench/futex-hash: Support preallocate hash table Thomas Gleixner
2016-05-05 20:44 ` [patch V2 7/7] futex.2: Document hash preallocation opcode Thomas Gleixner
  -- strict thread matches above, loose matches on Subject: below --
2016-05-05 19:03 [patch V2 0/7] Sebastian Andrzej Siewior <bigeasy@linutronix.de>, Linus Torvalds <torvalds@linux-foundation.org>, Darren Hart <darren@dvhart.com>, Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@kernel.org>, Michael Kerrisk <mtk.manpages@googlemail.com>, Davidlohr Bueso <dave@stgolabs.net>, Chris Mason <clm@fb.com>, Carlos O'Donell <carlos@redhat.com>, Torvald Riegel <triegel@redhat.com>, Eric Dumazet <edumazet@google.com> Thomas Gleixner
2016-05-05 19:03 ` [patch V2 2/7] futex: Hash private futexes per process Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).