From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from e7.ny.us.ibm.com (e7.ny.us.ibm.com [32.97.182.137]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4259B2C009F for ; Mon, 13 Jan 2014 17:38:33 +1100 (EST) Received: from /spool/local by e7.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 13 Jan 2014 01:38:29 -0500 Received: from b01cxnp22034.gho.pok.ibm.com (b01cxnp22034.gho.pok.ibm.com [9.57.198.24]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id ABA58C9003E for ; Mon, 13 Jan 2014 01:38:25 -0500 (EST) Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by b01cxnp22034.gho.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s0D6cRhV1245598 for ; Mon, 13 Jan 2014 06:38:28 GMT Received: from d01av03.pok.ibm.com (localhost [127.0.0.1]) by d01av03.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s0D6cRJe027250 for ; Mon, 13 Jan 2014 01:38:27 -0500 Message-ID: <52D3890B.8040201@linux.vnet.ibm.com> Date: Mon, 13 Jan 2014 12:04:51 +0530 From: Preeti U Murthy MIME-Version: 1.0 To: Michael Ellerman Subject: Re: [PATCH] pseries/cpuidle: Remove redundant call to ppc64_runlatch_off() in cpu idle routines References: <20140109050519.11532.6044.stgit@preeti.in.ibm.com> <1389591507.29912.6.camel@concordia> In-Reply-To: <1389591507.29912.6.camel@concordia> Content-Type: text/plain; charset=UTF-8 Cc: linuxppc-dev@lists.ozlabs.org, paulus@samba.org, deepthi@linux.vnet.ibm.com List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Hi Mikey I have the patch with the changelog according to your suggestion below. Thanks On 01/13/2014 11:08 AM, Michael Ellerman wrote: > On Thu, 2014-01-09 at 10:35 +0530, Preeti U Murthy wrote: >> Commit fbd7740fdfdf9475f switched pseries cpu idle handling from complete idle >> loops to ppc_md.powersave functions. Earlier to this switch, >> ppc64_runlatch_off() had to be called in each of the idle routines. But after >> the switch this call is handled in arch_cpu_idle(),just before the call >> to ppc_md.powersave, where platform specific idle routines are called. >> >> As a consequence, the call to ppc64_runlatch_off() got duplicated in the >> arch_cpu_idle() routine as well as in the some of the idle routines in >> pseries and commit fbd7740fdfdf9475f missed to get rid of these redundant >> calls. These calls were carried over subsequent enhancements to the pseries >> cpuidle routines. This patch takes care of eliminating this redundancy. > > It's "obvious" that turning the runlatch off multiple times is harmless, > although it adds extra overhead, but please spell that out in the changelog. > > cheers > > pseries/cpuidle: Remove redundant call to ppc64_runlatch_off() in cpu idle routines From: Preeti U Murthy Commit fbd7740fdfdf9475f(powerpc: Simplify pSeries idle loop) switched pseries cpu idle handling from complete idle loops to ppc_md.powersave functions. Earlier to this switch, ppc64_runlatch_off() had to be called in each of the idle routines. But after the switch, this call is handled in arch_cpu_idle(),just before the call to ppc_md.powersave, where platform specific idle routines are called. As a consequence, the call to ppc64_runlatch_off() got duplicated in the arch_cpu_idle() routine as well as in the some of the idle routines in pseries and commit fbd7740fdfdf9475f missed to get rid of these redundant calls. These calls were carried over subsequent enhancements to the pseries cpuidle routines. Although multiple calls to ppc64_runlatch_off() is harmless, there is still some overhead due to it. Besides that, these calls could also make way for a misunderstanding that it is *necessary* to call ppc64_runlatch_off() multiple times, when that is not the case. Hence this patch takes care of eliminating this redundancy. Signed-off-by: Preeti U Murthy --- arch/powerpc/platforms/pseries/processor_idle.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/powerpc/platforms/pseries/processor_idle.c b/arch/powerpc/platforms/pseries/processor_idle.c index a166e38..09e4f56 100644 --- a/arch/powerpc/platforms/pseries/processor_idle.c +++ b/arch/powerpc/platforms/pseries/processor_idle.c @@ -17,7 +17,6 @@ #include #include #include -#include #include struct cpuidle_driver pseries_idle_driver = { @@ -63,7 +62,6 @@ static int snooze_loop(struct cpuidle_device *dev, set_thread_flag(TIF_POLLING_NRFLAG); while ((!need_resched()) && cpu_online(cpu)) { - ppc64_runlatch_off(); HMT_low(); HMT_very_low(); } @@ -103,7 +101,6 @@ static int dedicated_cede_loop(struct cpuidle_device *dev, idle_loop_prolog(&in_purr); get_lppaca()->donate_dedicated_cpu = 1; - ppc64_runlatch_off(); HMT_medium(); check_and_cede_processor(); Regards Preeti U Murthy