From: Jens Axboe <[email protected]>
To: Thomas Gleixner <[email protected]>,
Peter Zijlstra <[email protected]>
Cc: "Jann Horn" <[email protected]>, "Ingo Molnar" <[email protected]>,
"Darren Hart" <[email protected]>,
"Davidlohr Bueso" <[email protected]>,
"André Almeida" <[email protected]>,
"kernel list" <[email protected]>,
"Pavel Begunkov" <[email protected]>,
io-uring <[email protected]>
Subject: Re: futex+io_uring: futex_q::task can maybe be dangling (but is not actually accessed, so it's fine)
Date: Wed, 15 Jan 2025 08:23:39 -0700 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <877c6wcra6.ffs@tglx>
On 1/15/25 3:20 AM, Thomas Gleixner wrote:
> On Mon, Jan 13 2025 at 15:38, Peter Zijlstra wrote:
>> On Fri, Jan 10, 2025 at 08:33:34PM -0700, Jens Axboe wrote:
>>
>>> @@ -548,7 +549,7 @@ void __futex_queue(struct futex_q *q, struct futex_hash_bucket *hb)
>>>
>>> plist_node_init(&q->list, prio);
>>> plist_add(&q->list, &hb->chain);
>>> - q->task = current;
>>> + q->task = task;
>>> }
>>>
>>> /**
>>
>> The alternative is, I suppose, to move the q->task assignment out to
>> these two callsites instead. Thomas, any opinions?
>
> That's fine as long as hb->lock is held, but the explicit argument makes
> all of this simpler to understand.
>
> Though I'm not really a fan of this part:
>
>> + __futex_queue(&ifd->q, hb, NULL);
>> + spin_unlock(&hb->lock);
>
> Can we please add that @task argument to futex_queue() and keep the
> internals in the futex code instead of pulling more stuff into io_uring?
Sure, was trying to keep the change more minimal, but we can certainly
add it to futex_queue() instead rather than needing to work around it on
the io_uring side.
I'll be happy to send out a patch for that.
--
Jens Axboe
next prev parent reply other threads:[~2025-01-15 15:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-10 22:26 futex+io_uring: futex_q::task can maybe be dangling (but is not actually accessed, so it's fine) Jann Horn
2025-01-11 3:33 ` Jens Axboe
2025-01-13 13:53 ` Jann Horn
2025-01-13 14:38 ` Peter Zijlstra
2025-01-13 14:41 ` Jens Axboe
2025-01-15 10:20 ` Thomas Gleixner
2025-01-15 15:23 ` Jens Axboe [this message]
2025-01-15 15:32 ` Jens Axboe
2025-01-15 17:05 ` Thomas Gleixner
2025-01-15 17:07 ` Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox