Thread (76 messages) 76 messages, 12 authors, 2023-10-09

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

From: Peter Zijlstra <peterz@infradead.org>
Date: 2023-07-28 22:04:34
Also in: bpf, kvm, linux-doc, linux-kselftest, linux-mm, lkml, rcu

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 (local)
NOT-Signed-off-by: Peter Zijlstra (Intel) [off-list ref]
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 ;-)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help