Stamp softlockup thread earlier before do_timer, because the latter is the one to actually trigger lock warning for long-time offline. Or else, I obserevd softlockup warning easily at manual vcpu hot-remove/plug, or when suspend cancel into old context. One point here is to cover both stolen and blocked time to compare with offline threshold. vcpu hotplug falls into 'stolen' case, but it's not enough. Considering xen time model is tickless at idle, it's possible that big block time is requested which also inflames softlockup thread. Signed-off-by Kevin Tian diff -r dcd62413d57b linux-2.6-xen-sparse/arch/i386/kernel/time-xen.c --- a/linux-2.6-xen-sparse/arch/i386/kernel/time-xen.c Fri Jan 26 17:04:51 2007 +0800 +++ b/linux-2.6-xen-sparse/arch/i386/kernel/time-xen.c Tue Jan 30 15:58:41 2007 +0800 @@ -157,6 +157,11 @@ static int __init __permitted_clock_jitt } __setup("permitted_clock_jitter=", __permitted_clock_jitter); +/* Threshold to stamp softlockup thread to avoid warning for + * long-time offline case, like vcpu hotplug. + */ +static u64 offline_threshold = 5000000000ULL; /* 5s */ + #if 0 static void delay_tsc(unsigned long loops) { @@ -660,6 +665,10 @@ irqreturn_t timer_interrupt(int irq, voi per_cpu(processed_system_time, i)); } + /* Offlined for more than a few seconds? Avoid lockup warnings. */ + if (stolen + blocked > offline_threshold) + touch_softlockup_watchdog(); + /* System-wide jiffy work. */ while (delta >= NS_PER_TICK) { delta -= NS_PER_TICK; @@ -715,10 +724,6 @@ irqreturn_t timer_interrupt(int irq, voi (cputime_t)delta_cpu); } - /* Offlined for more than a few seconds? Avoid lockup warnings. */ - if (stolen > 5*HZ) - touch_softlockup_watchdog(); - /* Local timer processing (see update_process_times()). */ run_local_timers(); if (rcu_pending(cpu))