]> www.infradead.org Git - users/jedix/linux-maple.git/commit
posix-timers: Switch to jhash32()
authorThomas Gleixner <tglx@linutronix.de>
Sat, 8 Mar 2025 16:48:40 +0000 (17:48 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 13 Mar 2025 11:07:17 +0000 (12:07 +0100)
commit781764e0b4394fbd8e8eb39195f8a076b60808b3
tree6d6d67491ea19bfbff9d81c8b2134e7d9680282d
parent1535cb80286e6fbc834f075039f85274538543c7
posix-timers: Switch to jhash32()

The hash distribution of hash_32() is suboptimal. jhash32() provides a way
better distribution, which evens out the length of the hash bucket lists,
which in turn avoids large outliers in list walk times.

Due to the sparse ID space (thanks CRIU) there is no guarantee that the
timers will be fully evenly distributed over the hash buckets, but the
behaviour is way better than with hash_32() even for randomly sparse ID
spaces.

For a pathological test case with 64 processes creating and accessing
20000 timers each, this results in a runtime reduction of ~10% and a
significantly reduced runtime variation.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20250308155624.279080328@linutronix.de
kernel/time/posix-timers.c