WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] CPUIDLE: fix a racing in cpuidle_wakeup_mwait

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] CPUIDLE: fix a racing in cpuidle_wakeup_mwait
From: "Wei, Gang" <gang.wei@xxxxxxxxx>
Date: Thu, 22 Apr 2010 12:57:21 +0800
Accept-language: zh-CN, en-US
Acceptlanguage: zh-CN, en-US
Cc: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Delivery-date: Wed, 21 Apr 2010 21:58:41 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acrh2EpmrHdf2p2DRdmsGiT5GetZ+A==
Thread-topic: [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@xxxxxxxxxxxxx> 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@xxxxxxxxx>

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)

Attachment: fix_mwait_wakeup.patch
Description: fix_mwait_wakeup.patch

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] CPUIDLE: fix a racing in cpuidle_wakeup_mwait, Wei, Gang <=