Skip to content

[PW_SID:1119990] futex: Optimise the size check get_futex_key()#2195

Closed
linux-riscv-bot wants to merge 2 commits into
workflow__riscv__fixesfrom
pw1119990
Closed

[PW_SID:1119990] futex: Optimise the size check get_futex_key()#2195
linux-riscv-bot wants to merge 2 commits into
workflow__riscv__fixesfrom
pw1119990

Conversation

@linux-riscv-bot

Copy link
Copy Markdown

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

Linux RISC-V bot and others added 2 commits July 1, 2026 03:48
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>
@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "futex: Optimise the size check get_futex_key()"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 120.99 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "futex: Optimise the size check get_futex_key()"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1415.79 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "futex: Optimise the size check get_futex_key()"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1696.67 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "futex: Optimise the size check get_futex_key()"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 21.40 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "futex: Optimise the size check get_futex_key()"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 23.55 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "futex: Optimise the size check get_futex_key()"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 1.54 seconds
Result: WARNING
Output:

CHECK: spaces preferred around that '-' (ctx:VxV)
#40: FILE: kernel/futex/core.c:523:
+	if (unlikely((address & (size-1)) != 0))
 	                             ^

total: 0 errors, 0 warnings, 1 checks, 8 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Commit 59c8ee54d09c ("futex: Optimise the size check get_futex_key()") has style problems, please review.

NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT CAMELCASE COMMIT_LOG_LONG_LINE GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.
total: 0 errors, 0 warnings, 1 checks, 8 lines checked
CHECK: spaces preferred around that '-' (ctx:VxV)


@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "futex: Optimise the size check get_futex_key()"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 79.08 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "futex: Optimise the size check get_futex_key()"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "futex: Optimise the size check get_futex_key()"
kdoc
Desc: Detects for kdoc errors
Duration: 1.20 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "futex: Optimise the size check get_futex_key()"
module-param
Desc: Detect module_param changes
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "futex: Optimise the size check get_futex_key()"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.22 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "futex: Optimise the size check get_futex_key()"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot
linux-riscv-bot force-pushed the workflow__riscv__fixes branch 3 times, most recently from a50938c to 40ba5ca Compare July 8, 2026 17:32
@linux-riscv-bot
linux-riscv-bot deleted the pw1119990 branch July 9, 2026 04:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant