Skip to content

Commit

Permalink
x86/nmi: Mark 'ignore_nmis' as __read_mostly
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kostenzer Felix authored and Ingo Molnar committed Mar 8, 2016
1 parent e17dc65 commit 8e2a7f5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/x86/kernel/nmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <asm/nmi.h>
#include <asm/x86_init.h>
#include <asm/reboot.h>
#include <asm/cache.h>

#define CREATE_TRACE_POINTS
#include <trace/events/nmi.h>
Expand Down Expand Up @@ -69,7 +70,7 @@ struct nmi_stats {

static DEFINE_PER_CPU(struct nmi_stats, nmi_stats);

static int ignore_nmis;
static int ignore_nmis __read_mostly;

int unknown_nmi_panic;
/*
Expand Down

0 comments on commit 8e2a7f5

Please sign in to comment.