Re: Uclamp races due to non-atomic static_branch_likely updates

From: Steven Rostedt

Date: Tue Oct 20 2026 - 15:31:32 EST


On Tue, 20 Oct 2026 11:53:47 -0700
John Stultz <jstultz@xxxxxxxxxx> wrote:

> Maybe should the jump_label_update() logic be using something like
> stop_machine? Or should there still be a conditional on key->enabled
> in the unlikely case to make the behavior consistent? Or is there just
> something about the uclamp usage that is off?

There's never been any guarantee that all call sites would update
atomically. The first user of jump labels was tracepoints and I really do
not want stop machine involved with them.

Perhaps we could add an api like static_key_enable_atomic() and
static_key_disable_atomic() that would go through a stop_machine() and
update everything that way for those locations that need an atomic view of
the updated jump labels.

-- Steve