[PW_SID:1156007] perf bench futex: Define SYS_futex on 32-bit arches with 64-bit time_t - #2580
Open
linux-riscv-bot wants to merge 2 commits into
Open
[PW_SID:1156007] perf bench futex: Define SYS_futex on 32-bit arches with 64-bit time_t#2580linux-riscv-bot wants to merge 2 commits into
linux-riscv-bot wants to merge 2 commits into
Conversation
The kernel does not provide sys_futex() on 32-bit architectures that lack a 32-bit time representation, such as riscv32. Consequently glibc does not define SYS_futex there, only SYS_futex_time64, and perf bench's futex benchmarks fail to build: bench/futex.h: In function 'futex_syscall': bench/futex.h:77:18: error: 'SYS_futex' undeclared (first use in this function) Define SYS_futex as SYS_futex_time64 when only the latter is available. The guard and its comment are taken verbatim from tools/testing/selftests/futex/include/futextest.h, where they were added by commit 0485081 ("selftests/futex: Define SYS_futex on 32-bit architectures with 64-bit time_t"), keeping the two futex userspace headers in sync. No timespec conversion helper is needed on top of this. glibc lays out struct timespec on 32-bit architectures with 64-bit time_t as { int64 tv_sec; int32 tv_nsec; 32-bit pad }, which is compatible with struct __kernel_timespec, and every futex_wait()/futex_lock_pi()/ futex_wait_requeue_pi() call site in perf bench passes a NULL timeout anyway, so no timespec ever crosses the syscall boundary here. Note that an earlier and more ambitious attempt at this was commit c1ff12d ("perf bench futex: Add support for 32-bit systems with 64-bit time_t"), reverted by commit ba4026b ("Revert "perf bench futex: Add support for 32-bit systems with 64-bit time_t"") because it included linux/time_types.h, which is unavailable on older distributions. This change deliberately avoids that dependency and adds only the one guard needed to fix compilation. Signed-off-by: Nylon Chen <nylon.chen@sifive.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
linux-riscv-bot
force-pushed
the
workflow__riscv__fixes
branch
from
September 2, 2026 20:29
9ed823f to
a54e736
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR for series 1156007 applied to workflow__riscv__fixes
Name: perf bench futex: Define SYS_futex on 32-bit arches with 64-bit time_t
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1156007
Version: 1