]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
futex: Unbreak futex hashing
authorThomas Gleixner <tglx@linutronix.de>
Sun, 8 Mar 2020 18:07:17 +0000 (19:07 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 28 Apr 2020 18:03:52 +0000 (19:03 +0100)
commitb74665947b7399bd222346e2d33afd51810d0444
tree9f9e89f45262aa4b9e4b9ff9295887ecbcaa3eb3
parent87903c4d3a9b422cd1d254b693e84b95f9df0706
futex: Unbreak futex hashing

commit 8d67743653dce5a0e7aa500fcccb237cde7ad88e upstream.

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: 8019ad13ef7f ("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
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: Jann Horn <jannh@google.com>
kernel/futex.c