Re: [PATCH v12 21/21] selftests/futex: Add futex_numa_mpol

From: Sebastian Andrzej Siewior
Date: Mon May 05 2025 - 03:37:10 EST


> > @@ -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

This is odd but okay.

> > +/*
> > + * 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.

perfect.

> > +/*
> > + * 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.

No special reason. If ~0 is the default, go for it.

Sebastian