Re: [RFC PATCH v2 10/20] jump_label,module: Don't alloc static_key_mod for __ro_after_init keys

Peter Zijlstra
2023-07-28T22:04:33Z

On Thu, Jul 20, 2023 at 05:30:46PM +0100, Valentin Schneider wrote:
> From: Peter Zijlstra <peterz@infradead.org>
>
> When a static_key is marked ro_after_init, its state will never change
> (after init), therefore jump_label_update() will never need to iterate
> the entries, and thus module load won't actually need to track this --
> avoiding the static_key::next write.
>
> Therefore, mark these keys such that jump_label_add_module() might
> recognise them and avoid the modification.
>
> Use the special state: 'static_key_linked(key) && !static_key_mod(key)'
> to denote such keys.
>
> Link: http://lore.kernel.org/r/20230705204142.GB2813335@hirez.programming.kicks-ass.net
> NOT-Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> Signed-off-by: Valentin Schneider <vschneid@redhat.com>
> ---
> @Peter: I've barely touched this patch, it's just been writing a comment
> and fixing benign compilation issues, so credit's all yours really!

Ah, it works? Excellent! You can remove the NOT from the SoB then ;-)