[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250502191606.GC24078@noisy.programming.kicks-ass.net>
Date: Fri, 2 May 2025 21:16:06 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc: linux-kernel@...r.kernel.org,
André Almeida <andrealmeid@...lia.com>,
Darren Hart <dvhart@...radead.org>,
Davidlohr Bueso <dave@...olabs.net>, Ingo Molnar <mingo@...hat.com>,
Juri Lelli <juri.lelli@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Valentin Schneider <vschneid@...hat.com>,
Waiman Long <longman@...hat.com>
Subject: Re: [PATCH v12 21/21] selftests/futex: Add futex_numa_mpol
On Wed, Apr 16, 2025 at 06:29:21PM +0200, Sebastian Andrzej Siewior wrote:
> diff --git a/tools/testing/selftests/futex/include/futex2test.h b/tools/testing/selftests/futex/include/futex2test.h
> index 9d305520e849b..b664e8f92bfd7 100644
> --- a/tools/testing/selftests/futex/include/futex2test.h
> +++ b/tools/testing/selftests/futex/include/futex2test.h
> @@ -8,6 +8,11 @@
>
> #define u64_to_ptr(x) ((void *)(uintptr_t)(x))
>
> +struct futex32_numa {
> + futex_t futex;
> + futex_t numa;
> +};
> +
> /**
> * futex_waitv - Wait at multiple futexes, wake on any
> * @waiters: Array of waiters
> @@ -20,3 +25,32 @@ static inline int futex_waitv(volatile struct futex_waitv *waiters, unsigned lon
> {
> return syscall(__NR_futex_waitv, waiters, nr_waiters, flags, timo, clockid);
> }
> +
> +static inline int futex2_wait(volatile struct futex_waitv *waiters, unsigned long nr_waiters,
> + unsigned long flags, struct timespec *timo, clockid_t clockid)
> +{
> + return syscall(__NR_futex_waitv, waiters, nr_waiters, flags, timo, clockid);
> +}
So this one seemed unused, deleted it and
> +/*
> + * futex_wait2() - block on uaddr with optional timeout
> + * @val: Expected value
> + * @flags: FUTEX2 flags
> + * @timeout: Relative timeout
> + * @clockid: Clock id for the timeout
> + */
> +static inline int futex2_wait2(void *uaddr, long val, unsigned int flags,
> + struct timespec *timeout, clockid_t clockid)
> +{
> + return syscall(__NR_futex_wait, uaddr, val, 1, flags, timeout, clockid);
> +}
renamed this one.
> +/*
> + * futex2_wake() - Wake a number of futexes
> + * @nr: Number of threads to wake at most
> + * @flags: FUTEX2 flags
> + */
> +static inline int futex2_wake(void *uaddr, int nr, unsigned int flags)
> +{
> + return syscall(__NR_futex_wake, uaddr, 1, nr, flags);
> +}
Next question; you're setting bitmask to 1 instead of
FUTEX_BITSET_MATCH_ANY, which is the default value.
I'm going to make it ~0U unless you have a reason for this 1.
Powered by blists - more mailing lists