]> git.baikalelectronics.ru Git - kernel.git/commit
futex: Unbreak futex hashing
authorThomas Gleixner <tglx@linutronix.de>
Sun, 8 Mar 2020 18:07:17 +0000 (19:07 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 9 Mar 2020 21:33:09 +0000 (22:33 +0100)
commita478a07ce21acc59e54cab1b7812f92fb8e6314f
tree777ab98cc4f98ecf6d7ed407672811a91a57e9d5
parent92dde456766dc4bb5b53cc430eda1b2ca05aa111
futex: Unbreak futex hashing

The recent futex inode life time fix changed the ordering of the futex key
union struct members, but forgot to adjust the hash function accordingly,

As a result the hashing omits the leading 64bit and even hashes beyond the
futex key causing a bad hash distribution which led to a ~100% performance
regression.

Hand in the futex key pointer instead of a random struct member and make
the size calculation based of the struct offset.

Fixes: 92dde456766d ("futex: Fix inode life-time issue")
Reported-by: Rong Chen <rong.a.chen@intel.com>
Decoded-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Rong Chen <rong.a.chen@intel.com>
Link: https://lkml.kernel.org/r/87h7yy90ve.fsf@nanos.tec.linutronix.de
kernel/futex.c