Wei, Gang
2010-Apr-22 04:57 UTC
[Xen-devel] [PATCH] CPUIDLE: fix a racing in cpuidle_wakeup_mwait
CPUIDLE: fix a racing in cpuidle_wakeup_mwait On 21/04/2010 10:52, "Keir Fraser" <keir.fraser@eu.citrix.com> wrote: Oh, another one, which can **even occur without your patch**: CPU A adds itself to cpuidle_mwait_flags while cpuidle_wakeup_mwait() is running. That function doesn''t see CPU A in its first read of the cpumask so it does not set TIMER_SOFTIRQ for CPU A. But it then *does* see CPU A in its final read of the cpumask, and hence clears A from the caller''s mask. Hence the caller does not pass CPU A to cpumask_raise_softirq(). Hence CPU A is erroneously not woken. Solution for it, just use the snapshot of cpuidle_mwait_flags in cpuidle_wakeup_mwait. Signed-off-by: Wei Gang <gang.wei@intel.com> diff -r 57cabf99fd4d xen/arch/x86/acpi/cpu_idle.c --- a/xen/arch/x86/acpi/cpu_idle.c Wed Apr 21 14:32:31 2010 +0800 +++ b/xen/arch/x86/acpi/cpu_idle.c Thu Apr 22 12:44:29 2010 +0800 @@ -169,7 +169,7 @@ void cpuidle_wakeup_mwait(cpumask_t *mas for_each_cpu_mask(cpu, target) set_bit(TIMER_SOFTIRQ, &softirq_pending(cpu)); - cpus_andnot(*mask, *mask, cpuidle_mwait_flags); + cpus_andnot(*mask, *mask, target); } static void mwait_idle_with_hints(unsigned long eax, unsigned long ecx) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel