[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87cyoowud7.ffs@tglx>
Date: Mon, 10 Jun 2024 20:00:36 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: Peter Zijlstra <peterz@...radead.org>
Cc: LKML <linux-kernel@...r.kernel.org>, Steven Rostedt
<rostedt@...dmis.org>, Sam Sun <samsun1006219@...il.com>, x86@...nel.org,
syzkaller-bugs@...glegroups.com, xrivendell7@...il.com
Subject: Re: [patch 2/4] jump_label: Fix concurrency issues in
static_key_slow_dec()
On Mon, Jun 10 2024 at 19:57, Peter Zijlstra wrote:
> On Mon, Jun 10, 2024 at 02:46:36PM +0200, Thomas Gleixner wrote:
>
>> @@ -247,20 +247,25 @@ EXPORT_SYMBOL_GPL(static_key_disable);
>>
>> static bool static_key_slow_try_dec(struct static_key *key)
>> {
>> + int v;
>>
>> /*
>> + * Go into the slow path if key::enabled is less than or equal than
>> + * one. One is valid to shut down the key, anything less than one
>> + * is an imbalance, which is handled at the call site.
>> + *
>> + * That includes the special case of '-1' which is set in
>> + * static_key_slow_inc_cpuslocked(), but that's harmless as it is
>> + * fully serialized in the slow path below. By the time this task
>> + * acquires the jump label lock the value is back to one and the
>> + * retry under the lock must succeed.
>
> Harmless yes, but it really should not happen to begin with. If this
> happens it means someone wants to disable a key that is in the middle of
> getting enabled for the first time.
>
> I'm tempted to want a WARN here instead. Hmm?
No strong opinion
Powered by blists - more mailing lists