Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

once: use __section(".data.once")

.data.once contains nicely packed bool variables.
It is used already by DO_ONCE_LITE().

Using it also in DO_ONCE() removes holes in .data section.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Eric Dumazet and committed by
Jakub Kicinski
c2c60ea3 62803fec

+1 -1
+1 -1
include/linux/once.h
··· 38 38 #define DO_ONCE(func, ...) \ 39 39 ({ \ 40 40 bool ___ret = false; \ 41 - static bool ___done = false; \ 41 + static bool __section(".data.once") ___done = false; \ 42 42 static DEFINE_STATIC_KEY_TRUE(___once_key); \ 43 43 if (static_branch_unlikely(&___once_key)) { \ 44 44 unsigned long ___flags; \