google / kernel-sanitizers

Linux Kernel Sanitizers, fast bug-detectors for the Linux kernel
https://google.github.io/kernel-sanitizers/
436 stars 87 forks source link

jump_labels, kfence: Avoid IPIs on toggling static branch #167

Closed melver closed 2 years ago

melver commented 3 years ago

With ever increase core counts in modern CPUs, it would be wise to avoid triggering 2 IPIs due to static branch enable+disable for each KFENCE allocation.

Investigate making changes to the static_keys/jump_labels infrastructure, that would allow us to avoid the 2 IPIs we currently require. More details are already in a comment in the KFENCE code: https://github.com/google/kasan/blob/kfence/mm/kfence/core.c#L575

xairy commented 2 years ago

Should we move this to Bugzilla?

melver commented 2 years ago

Hmm, no, I consider this fixed by: https://lore.kernel.org/all/20211019102524.2807208-2-elver@google.com/

xairy commented 2 years ago

Let's close this then. Thanks!