Linux Perf Users
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ian Rogers <irogers@google.com>
Cc: "Nylon Chen" <nylon.chen@sifive.com>,
	"Namhyung Kim" <namhyung@kernel.org>,
	"Jiri Olsa" <jolsa@kernel.org>,
	"Adrian Hunter" <adrian.hunter@intel.com>,
	"James Clark" <james.clark@linaro.org>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Alexander Shishkin" <alexander.shishkin@linux.intel.com>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Thomas Gleixner" <tglx@kernel.org>,
	"André Almeida" <andrealmeid@igalia.com>,
	"Davidlohr Bueso" <dave@stgolabs.net>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Alexandre Ghiti" <alex@ghiti.fr>,
	linux-perf-users@vger.kernel.org,
	linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf bench futex: Define SYS_futex on 32-bit arches with 64-bit time_t
Date: Tue, 8 Sep 2026 17:51:00 -0300	[thread overview]
Message-ID: <aqB1NGbcNdAGJnST@x2> (raw)
In-Reply-To: <CAP-5=fUzqFPfN+xH8uqERugK9xsauUoxZTVr+YLGGXVRi6UC9w@mail.gmail.com>

On Wed, Sep 02, 2026 at 10:04:14PM -0700, Ian Rogers wrote:
> On Wed, Sep 2, 2026 at 2:32 AM Nylon Chen <nylon.chen@sifive.com> wrote:
> >
> > 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 04850819c65c ("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 c1ff12dac465 ("perf bench futex: Add support for 32-bit systems
> > with 64-bit time_t"), reverted by
> > commit ba4026b09d83 ("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>
> 
> Reviewed-by: Ian Rogers <irogers@google.com>

Thanks, applied to perf-tools-next, for v7.4.

- Arnaldo

      reply	other threads:[~2026-09-08 20:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-02  9:32 [PATCH] perf bench futex: Define SYS_futex on 32-bit arches with 64-bit time_t Nylon Chen
2026-09-02  9:37 ` sashiko-bot
2026-09-03  5:04 ` Ian Rogers
2026-09-08 20:51   ` Arnaldo Carvalho de Melo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aqB1NGbcNdAGJnST@x2 \
    --to=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alex@ghiti.fr \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=andrealmeid@igalia.com \
    --cc=dave@stgolabs.net \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=nylon.chen@sifive.com \
    --cc=palmer@dabbelt.com \
    --cc=peterz@infradead.org \
    --cc=tglx@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox