lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230712085803.GD3100107@hirez.programming.kicks-ass.net>
Date:   Wed, 12 Jul 2023 10:58:03 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Jens Axboe <axboe@...nel.dk>
Cc:     io-uring@...r.kernel.org, linux-kernel@...r.kernel.org,
        tglx@...utronix.de, mingo@...hat.com
Subject: Re: [PATCH 2/7] futex: factor out the futex wake handling

On Tue, Jul 11, 2023 at 06:47:00PM -0600, Jens Axboe wrote:
> In preparation for having another waker that isn't futex_wake_mark(),
> add a wake handler in futex_q. No extra data is associated with the
> handler outside of struct futex_q itself. futex_wake_mark() is defined as
> the standard wakeup helper, now set through futex_q_init like other
> defaults.

Urgh... so if I understand things right, you're going to replace this
with a custom wake function that does *NOT* put the task on the wake_q.

The wake_q will thus be empty and the task does not get woken up. I'm
presuming someone gets a notification instead somewhere somehow.

I might've been nice to mention some of this somewhere ...

> Signed-off-by: Jens Axboe <axboe@...nel.dk>
> ---
>  kernel/futex/futex.h    | 4 ++++
>  kernel/futex/requeue.c  | 3 ++-
>  kernel/futex/waitwake.c | 6 +++---
>  3 files changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/kernel/futex/futex.h b/kernel/futex/futex.h
> index d2949fca37d1..8eaf1a5ce967 100644
> --- a/kernel/futex/futex.h
> +++ b/kernel/futex/futex.h
> @@ -69,6 +69,9 @@ struct futex_pi_state {
>  	union futex_key key;
>  } __randomize_layout;
>  
> +struct futex_q;
> +typedef void (futex_wake_fn)(struct wake_q_head *wake_q, struct futex_q *q);
> +
>  /**
>   * struct futex_q - The hashed futex queue entry, one per waiting task
>   * @list:		priority-sorted list of tasks waiting on this futex
> @@ -98,6 +101,7 @@ struct futex_q {
>  
>  	struct task_struct *task;
>  	spinlock_t *lock_ptr;
> +	futex_wake_fn *wake;
>  	union futex_key key;
>  	struct futex_pi_state *pi_state;
>  	struct rt_mutex_waiter *rt_waiter;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ