Re: NOHZ: WARNING: at arch/x86/kernel/smp.c:123native_smp_send_reschedule

From: Borislav Petkov
Date: Fri May 10 2013 - 12:16:43 EST


On Fri, May 10, 2013 at 05:43:50PM +0200, Frederic Weisbecker wrote:
> Right. But this is adding a timer locally, from CPU 1 to CPU 1, as
> indicated in the trace with the "1 1" line. So the only way for
> this IPI to be self-sent is if the tick is stopped locally (cf:
> wake_up_full_nohz_cpu()).
>
> But the tick is not supposed to be stopped so early in a secondary CPU
> initialization. The tick can be stopped only from two places:
>
> 1) idle loop, but we haven't yet reached that place. cpu_idle() is
> called much later 2) interrupt exit, but interrupts are supposed to be
> disabled at this stage

Hmm, I see.

> So either interrupts are spuriously enabled early, or ts->tick_stopped
> is not correctly initialized.

Hmm, it can't be interrupts disabled because add_timer_on() does
spin_lock_irqsave() before calling wake_up_nohz_cpu()... Maybe something
like the below could help check this...

Although AFAICT, we're enabling interrupts much later in
start_secondary, even after we've set the bit in the online mask.

---
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 9c73b51817e4..1b679b0fa57a 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -201,6 +201,8 @@ static void __cpuinit smp_callin(void)
*/
setup_vector_irq(smp_processor_id());

+ WARN_ON(!irqs_disabled());
+
/*
* Save our processor parameters. Note: this information
* is needed for clock calibration.


--
Regards/Gruss,
Boris.

Sent from a fat crate under my desk. Formatting is fine.
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/