[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1f329aff-efd1-4996-9194-9e35030e9faa@redhat.com>
Date: Wed, 9 Jul 2025 14:28:13 -0400
From: Waiman Long <llong@...hat.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
Will Deacon <will@...nel.org>, Boqun Feng <boqun.feng@...il.com>,
Jonathan Corbet <corbet@....net>, linux-kernel@...r.kernel.org,
Jann Horn <jannh@...gle.com>
Subject: Re: [PATCH] locking/mutex: Disable preemption in
__mutex_unlock_slowpath()
On 7/9/25 2:21 PM, Linus Torvalds wrote:
> On Wed, 9 Jul 2025 at 11:19, Linus Torvalds
> <torvalds@...ux-foundation.org> wrote:
>> I absolutely detest the notion of "let's make locking be tied to
>> object lifetimes".
> Side note: I wonder if there's any way to detect this kind of race in general.
>
> 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.
I think we can do a a cond_resched() under CONFIG_DEBUG_MUTEXES and
CONFIG_KASAN. We certainly don't want to do that with a production kernel.
Cheers,
Longman
Powered by blists - more mailing lists