Re: [PATCH v2 4/7] jump_label: Add batching API for queued static key updates

From: Peter Zijlstra

Date: Fri Dec 04 2026 - 18:27:35 EST


On Fri, Dec 04, 2026 at 12:18:30PM -0700, jim.cromie@xxxxxxxxx wrote:

> Yes, that worked well -- I just posted v3 built around your
> batch_owner / static_key_batch guard design, dropping the @apply
> plumbing, *_queued() helpers, and STATIC_KEY_TRANS_DISABLE (-2).
>
> A few edge cases came up while wiring it up and testing with lockdep:
>
> 1. Added batch_depth and a batch_owner == current fastpath before
> cpus_read_lock() so nested batch guards and _cpuslocked() wrappers
> don't self-deadlock or drop the outer batch early.

Urgh, that gets us firmly in recursive locking territory -- and that has
proven to be a painful place time and time again.

What sites actually 'need' this; and can't we fix that differently?

> 2. Moved key queueing to jump_label_queue_key() (handling 0-site keys)
> with jump_label_flush_key() on revisits (e.g. "+p;-p"), plus
> static_key_disable() falling through on -1 onto jump_label_mutex.

Its not immediately clear what you mean here; did you force a flush when
a second operation on a previously queued key arrives?