Skip to content

Commit 278c9b0

Browse files
travis@sgi.comIngo Molnar
authored andcommitted
x86/platform/UV: Add basic CPU NMI health check
Add a low impact health check triggered by the system NMI command that essentially checks which CPUs are responding to external NMI's. Signed-off-by: Mike Travis <[email protected]> Reviewed-by: Russ Anderson <[email protected]> Reviewed-by: Alex Thorlton <[email protected]> Acked-by: Thomas Gleixner <[email protected]> Acked-by: Dimitri Sivanich <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent abdf1df commit 278c9b0

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

arch/x86/platform/uv/uv_nmi.c

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ module_param_named(debug, uv_nmi_debug, int, 0644);
176176
* "kdump" - do crash dump
177177
* "kdb" - enter KDB (default)
178178
* "kgdb" - enter KGDB
179+
* "health" - check if CPUs respond to NMI
179180
*/
180181
static char uv_nmi_action[8] = "kdb";
181182
module_param_string(action, uv_nmi_action, sizeof(uv_nmi_action), 0644);
@@ -571,6 +572,22 @@ static void uv_nmi_sync_exit(int master)
571572
}
572573
}
573574

575+
/* Current "health" check is to check which CPU's are responsive */
576+
static void uv_nmi_action_health(int cpu, struct pt_regs *regs, int master)
577+
{
578+
if (master) {
579+
int in = atomic_read(&uv_nmi_cpus_in_nmi);
580+
int out = num_online_cpus() - in;
581+
582+
pr_alert("UV: NMI CPU health check (non-responding:%d)\n", out);
583+
atomic_set(&uv_nmi_slave_continue, SLAVE_EXIT);
584+
} else {
585+
while (!atomic_read(&uv_nmi_slave_continue))
586+
cpu_relax();
587+
}
588+
uv_nmi_sync_exit(master);
589+
}
590+
574591
/* Walk through cpu list and dump state of each */
575592
static void uv_nmi_dump_state(int cpu, struct pt_regs *regs, int master)
576593
{
@@ -747,7 +764,9 @@ int uv_handle_nmi(unsigned int reason, struct pt_regs *regs)
747764
uv_nmi_wait(master);
748765

749766
/* Process actions other than "kdump": */
750-
if (uv_nmi_action_is("ips") || uv_nmi_action_is("dump")) {
767+
if (uv_nmi_action_is("health")) {
768+
uv_nmi_action_health(cpu, regs, master);
769+
} else if (uv_nmi_action_is("ips") || uv_nmi_action_is("dump")) {
751770
uv_nmi_dump_state(cpu, regs, master);
752771
} else if (uv_nmi_action_is("kdb") || uv_nmi_action_is("kgdb")) {
753772
uv_call_kgdb_kdb(cpu, regs, master);

0 commit comments

Comments
 (0)