Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 43929
b: refs/heads/master
c: 92715e2
h: refs/heads/master
i:
  43927: 9339559
v: v3
  • Loading branch information
Ravikiran G Thirumalai authored and Andi Kleen committed Dec 9, 2006
1 parent a8e298a commit 4113809
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 16d279d277aedd640d9dba5ddeb172b5e6bc7d75
refs/heads/master: 92715e282be7c7488f892703c8d39b08976a833b
8 changes: 4 additions & 4 deletions trunk/arch/i386/kernel/nmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,29 +195,29 @@ static __cpuinit inline int nmi_known_cpu(void)
return 0;
}

static int endflag __initdata = 0;

#ifdef CONFIG_SMP
/* The performance counters used by NMI_LOCAL_APIC don't trigger when
* the CPU is idle. To make sure the NMI watchdog really ticks on all
* CPUs during the test make them busy.
*/
static __init void nmi_cpu_busy(void *data)
{
volatile int *endflag = data;
local_irq_enable_in_hardirq();
/* Intentionally don't use cpu_relax here. This is
to make sure that the performance counter really ticks,
even if there is a simulator or similar that catches the
pause instruction. On a real HT machine this is fine because
all other CPUs are busy with "useless" delay loops and don't
care if they get somewhat less cycles. */
while (*endflag == 0)
barrier();
while (endflag == 0)
mb();
}
#endif

static int __init check_nmi_watchdog(void)
{
volatile int endflag = 0;
unsigned int *prev_nmi_count;
int cpu;

Expand Down
9 changes: 5 additions & 4 deletions trunk/arch/x86_64/kernel/nmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,29 +193,29 @@ void nmi_watchdog_default(void)
nmi_watchdog = NMI_IO_APIC;
}

static int endflag __initdata = 0;

#ifdef CONFIG_SMP
/* The performance counters used by NMI_LOCAL_APIC don't trigger when
* the CPU is idle. To make sure the NMI watchdog really ticks on all
* CPUs during the test make them busy.
*/
static __init void nmi_cpu_busy(void *data)
{
volatile int *endflag = data;
local_irq_enable_in_hardirq();
/* Intentionally don't use cpu_relax here. This is
to make sure that the performance counter really ticks,
even if there is a simulator or similar that catches the
pause instruction. On a real HT machine this is fine because
all other CPUs are busy with "useless" delay loops and don't
care if they get somewhat less cycles. */
while (*endflag == 0)
barrier();
while (endflag == 0)
mb();
}
#endif

int __init check_nmi_watchdog (void)
{
volatile int endflag = 0;
int *counts;
int cpu;

Expand Down Expand Up @@ -256,6 +256,7 @@ int __init check_nmi_watchdog (void)
if (!atomic_read(&nmi_active)) {
kfree(counts);
atomic_set(&nmi_active, -1);
endflag = 1;
return -1;
}
endflag = 1;
Expand Down

0 comments on commit 4113809

Please sign in to comment.