[PW_SID:1119990] futex: Optimise the size check get_futex_key()#2195
[PW_SID:1119990] futex: Optimise the size check get_futex_key()#2195linux-riscv-bot wants to merge 2 commits into
Conversation
The futex address must be naturally aligned and this is checked via "address % size" where `address' is the supplied address and `size' is the expected size of futex. It is guaranteed that `size' is power of two but the compiler does not see it and creates here a `div' operation (x86, arm, gcc-15). We can take advantage of the pow2 property and rewrite it as "address & (size-1)". As per testing, the command |perf bench futex hash -f 1 -b 16384 -t 1 -r 30 improved from | [thread 0] futex: 0x5619f931f740 [ 7001583 ops/sec ] to | [thread 0] futex: 0x55da173e5740 [ 7376137 ops/sec ] or by 5.3% Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "futex: Optimise the size check get_futex_key()" |
|
Patch 1: "futex: Optimise the size check get_futex_key()" |
|
Patch 1: "futex: Optimise the size check get_futex_key()" |
|
Patch 1: "futex: Optimise the size check get_futex_key()" |
|
Patch 1: "futex: Optimise the size check get_futex_key()" |
|
Patch 1: "futex: Optimise the size check get_futex_key()" |
|
Patch 1: "futex: Optimise the size check get_futex_key()" |
|
Patch 1: "futex: Optimise the size check get_futex_key()" |
|
Patch 1: "futex: Optimise the size check get_futex_key()" |
|
Patch 1: "futex: Optimise the size check get_futex_key()" |
|
Patch 1: "futex: Optimise the size check get_futex_key()" |
|
Patch 1: "futex: Optimise the size check get_futex_key()" |
a50938c to
40ba5ca
Compare
PR for series 1119990 applied to workflow__riscv__fixes
Name: futex: Optimise the size check get_futex_key()
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1119990
Version: 1