Re: [PATCH] once: Don't use a work queue to reset sleepable static key

From: Andrew Morton

Date: Sat Jan 10 2026 - 21:54:45 EST


On Thu, 8 Jan 2026 15:27:17 -0800 Tony Luck <tony.luck@xxxxxxxxx> wrote:

> Pointless overhead to use a work queue to reset the static key
> for a DO_ONCE_SLEEPABLE() invocation.
>
> ...
>
> --- a/lib/once.c
> +++ b/lib/once.c
> @@ -93,6 +93,7 @@ void __do_once_sleepable_done(bool *done, struct static_key_true *once_key,
> {
> *done = true;
> mutex_unlock(&once_mutex);
> - once_disable_jump(once_key, mod);
> + BUG_ON(!static_key_enabled(once_key));

Sauron's eye is upon us. Can we either justify nuking the kernel or
use a WARN_ON?

> + static_branch_disable(once_key);
> }
> EXPORT_SYMBOL(__do_once_sleepable_done);
> --
> 2.52.0