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

x86/nmi: Mark 'ignore_nmis' as __read_mostly

ignore_nmis is used in two distinct places:

1. modified through {stop,restart}_nmi by alternative_instructions
2. read by do_nmi to determine if default_do_nmi should be called or not

thus the access pattern conforms to __read_mostly and do_nmi() is a fastpath.

Signed-off-by: Kostenzer Felix <fkostenzer@live.at>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Kostenzer Felix and committed by
Ingo Molnar
8e2a7f5b e17dc653

+2 -1
+2 -1
arch/x86/kernel/nmi.c
··· 30 30 #include <asm/nmi.h> 31 31 #include <asm/x86_init.h> 32 32 #include <asm/reboot.h> 33 + #include <asm/cache.h> 33 34 34 35 #define CREATE_TRACE_POINTS 35 36 #include <trace/events/nmi.h> ··· 70 69 71 70 static DEFINE_PER_CPU(struct nmi_stats, nmi_stats); 72 71 73 - static int ignore_nmis; 72 + static int ignore_nmis __read_mostly; 74 73 75 74 int unknown_nmi_panic; 76 75 /*