From patchwork Thu Nov 27 10:59:52 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastien Dugue X-Patchwork-Id: 11170 X-Patchwork-Delegate: paulus@samba.org Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id B0D16DDF25 for ; Thu, 27 Nov 2008 22:00:56 +1100 (EST) X-Original-To: linuxppc-dev@ozlabs.org Delivered-To: linuxppc-dev@ozlabs.org Received: from ecfrec.frec.bull.fr (ecfrec.frec.bull.fr [129.183.4.8]) by ozlabs.org (Postfix) with ESMTP id A6A10DDE08 for ; Thu, 27 Nov 2008 21:59:58 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by ecfrec.frec.bull.fr (Postfix) with ESMTP id 159451A18F2; Thu, 27 Nov 2008 11:59:56 +0100 (CET) Received: from ecfrec.frec.bull.fr ([127.0.0.1]) by localhost (ecfrec.frec.bull.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 25754-04; Thu, 27 Nov 2008 11:59:52 +0100 (CET) Received: from cyclope.frec.bull.fr (cyclope.frec.bull.fr [129.183.4.9]) by ecfrec.frec.bull.fr (Postfix) with ESMTP id A76A31A18B0; Thu, 27 Nov 2008 11:59:52 +0100 (CET) Received: from localhost (frecb000686.frec.bull.fr [129.183.101.139]) by cyclope.frec.bull.fr (Postfix) with ESMTP id BF0C127289; Thu, 27 Nov 2008 11:59:49 +0100 (CET) Date: Thu, 27 Nov 2008 11:59:52 +0100 From: Sebastien Dugue To: linux-ppc Subject: [PATCH] powerpc/pseries: Fix cpu hotplug Message-ID: <20081127115952.1f7db89d@bull.net> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.2; i486-pc-linux-gnu) Mime-Version: 1.0 X-Virus-Scanned: by amavisd-new at frec.bull.fr Cc: Will Schmidt , Paul Mackerras , Jean Pierre Dion , Gilles Carry X-BeenThere: linuxppc-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Currently, pseries_cpu_die() calls msleep() while polling RTAS for the status of the dying cpu. However if the cpu that is going down also happens to be the one doing the tick then we're hosed as the tick_do_timer_cpu 'baton' is only passed later on in tick_shutdown() when _cpu_down() does the CPU_DEAD notification. Therefore jiffies won't be updated anymore. This patch replaces that msleep() with a cpu_relax() to make sure we're not going to schedule at that point. With this patch my test box survives a 100k iterations hotplug stress test on _all_ cpus, whereas without it, it quickly dies after ~50 iterations. Signed-off-by: Sebastien Dugue Cc: Paul Mackerras Cc: Michael Ellerman --- arch/powerpc/platforms/pseries/hotplug-cpu.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c index 1f03248..a20ead8 100644 --- a/arch/powerpc/platforms/pseries/hotplug-cpu.c +++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c @@ -116,7 +116,7 @@ static void pseries_cpu_die(unsigned int cpu) cpu_status = query_cpu_stopped(pcpu); if (cpu_status == 0 || cpu_status == -1) break; - msleep(200); + cpu_relax(); } if (cpu_status != 0) { printk("Querying DEAD? cpu %i (%i) shows %i\n",