[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87il9qu0yx.ffs@tglx>
Date: Mon, 07 Aug 2023 21:05:58 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: Peter Zijlstra <peterz@...radead.org>, axboe@...nel.dk
Cc: linux-kernel@...r.kernel.org, peterz@...radead.org,
mingo@...hat.com, dvhart@...radead.org, dave@...olabs.net,
andrealmeid@...lia.com, Andrew Morton <akpm@...ux-foundation.org>,
urezki@...il.com, hch@...radead.org, lstoakes@...il.com,
Arnd Bergmann <arnd@...db.de>, linux-api@...r.kernel.org,
linux-mm@...ck.org, linux-arch@...r.kernel.org,
malteskarupke@....de, Geert Uytterhoeven <geert@...ux-m68k.org>
Subject: Re: [PATCH v2 09/14] futex: Add sys_futex_requeue()
On Mon, Aug 07 2023 at 14:18, Peter Zijlstra wrote:
> Finish of the 'simple' futex2 syscall group by adding
s/of/off/
> sys_futex_requeue(). Unlike sys_futex_{wait,wake}() its arguments are
> too numerous to fit into a regular syscall. As such, use struct
> futex_waitv to pass the 'source' and 'destination' futexes to the
> syscall.
...
> +/*
> + * sys_futex_requeue - Requeue a waiter from one futex to another
> + * @waiters: array describing the source and destination futex
> + * @flags: unused
> + * @nr_wake: number of futexes to wake
> + * @nr_requeue: number of futexes to requeue
Tabular format please
> + *
> + * Identical to the traditional FUTEX_CMP_REQUEUE op, except it is part of the
> + * futex2 family of calls.
> + */
> +
> +SYSCALL_DEFINE4(futex_requeue,
> + struct futex_waitv __user *, waiters,
> + unsigned int, flags,
> + int, nr_wake,
> + int, nr_requeue)
> +{
> + struct futex_vector futexes[2];
> + u32 cmpval;
> + int ret;
> +
> + if (flags)
> + return -EINVAL;
> +
> + if (!waiters)
> + return -EINVAL;
> +
> + ret = futex_parse_waitv(futexes, waiters, 2);
> + if (ret)
> + return ret;
> +
> + cmpval = futexes[0].w.val;
> +
> + return futex_requeue(u64_to_user_ptr(futexes[0].w.uaddr), futexes[0].w.flags,
> + u64_to_user_ptr(futexes[1].w.uaddr), futexes[1].w.flags,
> + nr_wake, nr_requeue, &cmpval, 0);
> +}
Reviewed-by: Thomas Gleixner <tglx@...utronix.de>
Powered by blists - more mailing lists