From: Peter Zijlstra <peterz@infradead.org>
To: Alexey Izbyshev <izbyshev@ispras.ru>
Cc: linux-kernel@vger.kernel.org,
"Thomas Gleixner" <tglx@linutronix.de>,
"Ingo Molnar" <mingo@redhat.com>,
"Darren Hart" <dvhart@infradead.org>,
"Davidlohr Bueso" <dave@stgolabs.net>,
"André Almeida" <andrealmeid@igalia.com>,
"Yi Wang" <wang.yi59@zte.com.cn>,
"Yang Tao" <yang.tao172@zte.com.cn>
Subject: Re: [PATCH] futex: Resend potentially swallowed owner death notification
Date: Mon, 14 Nov 2022 12:37:31 +0100 [thread overview]
Message-ID: <Y3Ioe9xq6XE9fmgN@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20221111215439.248185-1-izbyshev@ispras.ru>
On Sat, Nov 12, 2022 at 12:54:39AM +0300, Alexey Izbyshev wrote:
> Commit ca16d5bee598 ("futex: Prevent robust futex exit race") addressed
> two cases when tasks waiting on a robust non-PI futex remained blocked
> despite the futex not being owned anymore:
>
> * if the owner died after writing zero to the futex word, but before
> waking up a waiter
>
> * if a task waiting on the futex was woken up, but died before updating
> the futex word (effectively swallowing the notification without acting
> on it)
>
> In the second case, the task could be woken up either by the previous
> owner (after the futex word was reset to zero) or by the kernel (after
> the OWNER_DIED bit was set and the TID part of the futex word was reset
> to zero) if the previous owner died without the resetting the futex.
> Because the referenced commit wakes up a potential waiter only if the
> whole futex word is zero, the latter subcase remained unaddressed.
>
> Fix this by looking only at the TID part of the futex when deciding
> whether a wake up is needed.
>
> Fixes: ca16d5bee598 ("futex: Prevent robust futex exit race")
> Signed-off-by: Alexey Izbyshev <izbyshev@ispras.ru>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
next prev parent reply other threads:[~2022-11-14 11:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-11 21:54 Alexey Izbyshev
2022-11-14 11:37 ` Peter Zijlstra [this message]
2022-12-02 11:28 ` [tip: locking/core] " tip-bot2 for Alexey Izbyshev
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 \
--in-reply-to=Y3Ioe9xq6XE9fmgN@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=andrealmeid@igalia.com \
--cc=dave@stgolabs.net \
--cc=dvhart@infradead.org \
--cc=izbyshev@ispras.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=wang.yi59@zte.com.cn \
--cc=yang.tao172@zte.com.cn \
/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
all inboxes | Powered by JetHome®