From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: [PATCH 3/4] x86/nmi: wait for all CPUs in check_nmi_watchdog() Date: Wed, 14 May 2014 13:58:18 +0100 Message-ID: <1400072299-2285-4-git-send-email-david.vrabel@citrix.com> References: <1400072299-2285-1-git-send-email-david.vrabel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WkYlo-0001y3-O6 for xen-devel@lists.xenproject.org; Wed, 14 May 2014 12:58:52 +0000 In-Reply-To: <1400072299-2285-1-git-send-email-david.vrabel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Keir Fraser , David Vrabel , Jan Beulich List-Id: xen-devel@lists.xenproject.org The counting of a CPUs NMIs in check_nmi_watchdog() is only reliable if all CPUs have been spinning for 5 or more ticks. There may be delays in waking other CPUs from deep power states that can mean that when the counts are checked CPUs haven't run for long enough. Fix this by waiting for all CPUs to have delayed in wait_for_nmis(). Signed-off-by: David Vrabel --- xen/arch/x86/nmi.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c index 07488da..4f330d8 100644 --- a/xen/arch/x86/nmi.c +++ b/xen/arch/x86/nmi.c @@ -136,9 +136,7 @@ int __init check_nmi_watchdog (void) /* Wait for 10 ticks. Busy-wait on all CPUs: the LAPIC counter that * the NMI watchdog uses only runs while the core's not halted */ - if ( nmi_watchdog == NMI_LOCAL_APIC ) - smp_call_function(wait_for_nmis, NULL, 0); - wait_for_nmis(NULL); + on_selected_cpus(&cpu_online_map, wait_for_nmis, NULL, 1); for_each_online_cpu ( cpu ) { -- 1.7.10.4