[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250516125336.zd1aBkwv@linutronix.de>
Date: Fri, 16 May 2025 14:53:36 +0200
From: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To: André Almeida <andrealmeid@...lia.com>
Cc: Darren Hart <dvhart@...radead.org>, linux-kernel@...r.kernel.org,
Davidlohr Bueso <dave@...olabs.net>, Ingo Molnar <mingo@...hat.com>,
Juri Lelli <juri.lelli@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>,
Valentin Schneider <vschneid@...hat.com>,
Waiman Long <longman@...hat.com>
Subject: Re: [PATCH v12 03/21] futex: Move futex_queue() into
futex_wait_setup()
On 2025-05-05 18:43:16 [-0300], André Almeida wrote:
> > --- a/kernel/futex/waitwake.c
> > +++ b/kernel/futex/waitwake.c
> > @@ -339,18 +339,8 @@ static long futex_wait_restart(struct restart_block *restart);
> > * @q: the futex_q to queue up on
> > * @timeout: the prepared hrtimer_sleeper, or null for no timeout
> > */
> > -void futex_wait_queue(struct futex_hash_bucket *hb, struct futex_q *q,
> > - struct hrtimer_sleeper *timeout)
> > +void futex_do_wait(struct futex_q *q, struct hrtimer_sleeper *timeout)
>
> Update the name in the kernel doc comment as well. Also drop from the
> comment the part that says "futex_queue() and ..."
This has been done.
…
> > @@ -636,10 +629,25 @@ int futex_wait_setup(u32 __user *uaddr, u32 val, unsigned int flags,
> > }
> > if (uval != val) {
> > - futex_q_unlock(*hb);
> > - ret = -EWOULDBLOCK;
> > + futex_q_unlock(hb);
> > + return -EWOULDBLOCK;
> > }
> > + if (key2 && futex_match(&q->key, key2)) {
> > + futex_q_unlock(hb);
> > + return -EINVAL;
>
> Please add this new ret value in the kernel doc too.
I'm going to add this:
--- a/kernel/futex/waitwake.c
+++ b/kernel/futex/waitwake.c
@@ -585,7 +585,8 @@ int futex_wait_multiple(struct futex_vector *vs, unsigned int count,
*
* Return:
* - 0 - uaddr contains val and hb has been locked;
- * - <1 - -EFAULT or -EWOULDBLOCK (uaddr does not contain val) and hb is unlocked
+ * - <0 - On error and the hb is unlocked. A possible reason: the uaddr can not
+ * be read, does not contain the expected value or is not properly aligned.
*/
int futex_wait_setup(u32 __user *uaddr, u32 val, unsigned int flags,
struct futex_q *q, union futex_key *key2,
Sebastian
Powered by blists - more mailing lists