From: Waiman Long <llong@redhat.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>, Will Deacon <will@kernel.org>,
Boqun Feng <boqun.feng@gmail.com>,
Jonathan Corbet <corbet@lwn.net>,
linux-kernel@vger.kernel.org, Jann Horn <jannh@google.com>
Subject: Re: [PATCH] locking/mutex: Disable preemption in __mutex_unlock_slowpath()
Date: Wed, 9 Jul 2025 15:42:46 -0400 [thread overview]
Message-ID: <700c49da-1e30-4b99-ad41-3b052c80b64b@redhat.com> (raw)
In-Reply-To: <CAHk-=wjT5Y36Xs1zdE1OdM-AwxUMcC9fQC=8r1_GvawP1oqC3Q@mail.gmail.com>
On 7/9/25 2:28 PM, Linus Torvalds wrote:
> On Wed, 9 Jul 2025 at 11:21, Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
>> And I suspect it would involve the exact *opposite* of your patch:
>> make mutex_unlock() actively cause preemption after it has released
>> the lock but before it has done the final accesses.
> .. sadly, I suspect we have a ton of mutex_unlock() users in atomic
> contexts, so we probably can't do that. It's not like you *should* do
> it, but I don't think we've ever disallowed it.
>
> You can't use mutex_unlock from interrupts etc, but you can use it
> while holding a spinlock.
I have just sent out another mutex patch to enforce a context switch in
__mutex_unlock_slowpath() under the right context.
As for this one, you are right that hiding it may not be the best idea.
So I am going to drop it.
Cheers,
Longman
prev parent reply other threads:[~2025-07-09 19:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-09 18:05 Waiman Long
2025-07-09 18:19 ` Waiman Long
2025-07-09 18:19 ` Linus Torvalds
2025-07-09 18:21 ` Linus Torvalds
2025-07-09 18:28 ` Waiman Long
2025-07-09 18:28 ` Linus Torvalds
2025-07-09 19:42 ` Waiman Long [this message]
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=700c49da-1e30-4b99-ad41-3b052c80b64b@redhat.com \
--to=llong@redhat.com \
--cc=boqun.feng@gmail.com \
--cc=corbet@lwn.net \
--cc=jannh@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=torvalds@linux-foundation.org \
--cc=will@kernel.org \
/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®