]> 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)
commit6a87e1d1f382aa6b501a513fd3b1c0b3c00abe1e
tree777ab98cc4f98ecf6d7ed407672811a91a57e9d5
parentfb796c0eb40b2742659d450618538a824eecd789
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: fb796c0eb40b ("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