* [PATCH] pseries/cpuidle: Remove redundant call to ppc64_runlatch_off() in cpu idle routines
@ 2014-01-09 5:05 Preeti U Murthy
2014-01-09 8:07 ` Srivatsa S. Bhat
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Preeti U Murthy @ 2014-01-09 5:05 UTC (permalink / raw)
To: paulus, linuxppc-dev, deepthi, benh
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.
Signed-off-by: Preeti U Murthy <preeti@linux.vnet.ibm.com>
---
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 <asm/reg.h>
#include <asm/machdep.h>
#include <asm/firmware.h>
-#include <asm/runlatch.h>
#include <asm/plpar_wrappers.h>
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();
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] pseries/cpuidle: Remove redundant call to ppc64_runlatch_off() in cpu idle routines
2014-01-09 5:05 [PATCH] pseries/cpuidle: Remove redundant call to ppc64_runlatch_off() in cpu idle routines Preeti U Murthy
@ 2014-01-09 8:07 ` Srivatsa S. Bhat
2014-01-13 3:57 ` Deepthi Dharwar
2014-01-13 5:38 ` Michael Ellerman
2 siblings, 0 replies; 6+ messages in thread
From: Srivatsa S. Bhat @ 2014-01-09 8:07 UTC (permalink / raw)
To: Preeti U Murthy; +Cc: linuxppc-dev, paulus, deepthi
On 01/09/2014 10:35 AM, 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.
>
> Signed-off-by: Preeti U Murthy <preeti@linux.vnet.ibm.com>
> ---
Reviewed-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Regards,
Srivatsa S. Bhat
>
> 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 <asm/reg.h>
> #include <asm/machdep.h>
> #include <asm/firmware.h>
> -#include <asm/runlatch.h>
> #include <asm/plpar_wrappers.h>
>
> 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();
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] pseries/cpuidle: Remove redundant call to ppc64_runlatch_off() in cpu idle routines
2014-01-09 5:05 [PATCH] pseries/cpuidle: Remove redundant call to ppc64_runlatch_off() in cpu idle routines Preeti U Murthy
2014-01-09 8:07 ` Srivatsa S. Bhat
@ 2014-01-13 3:57 ` Deepthi Dharwar
2014-01-13 4:22 ` Preeti U Murthy
2014-01-13 5:38 ` Michael Ellerman
2 siblings, 1 reply; 6+ messages in thread
From: Deepthi Dharwar @ 2014-01-13 3:57 UTC (permalink / raw)
To: Preeti U Murthy; +Cc: linuxppc-dev, paulus
On 01/09/2014 10:35 AM, 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.
>
> Signed-off-by: Preeti U Murthy <preeti@linux.vnet.ibm.com>
> ---
Acked-by: Deepthi Dharwar <deepthi@linux.vnet.ibm.com>
Preeti, I will include this patch as part of the pseries cpuidle driver
clean-ups series which I have undertaken.
Regards,
Deepthi
> 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 <asm/reg.h>
> #include <asm/machdep.h>
> #include <asm/firmware.h>
> -#include <asm/runlatch.h>
> #include <asm/plpar_wrappers.h>
>
> 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();
>
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] pseries/cpuidle: Remove redundant call to ppc64_runlatch_off() in cpu idle routines
2014-01-13 3:57 ` Deepthi Dharwar
@ 2014-01-13 4:22 ` Preeti U Murthy
0 siblings, 0 replies; 6+ messages in thread
From: Preeti U Murthy @ 2014-01-13 4:22 UTC (permalink / raw)
To: Deepthi Dharwar; +Cc: linuxppc-dev, paulus
Hi Deepthi,
On 01/13/2014 09:27 AM, Deepthi Dharwar wrote:
> On 01/09/2014 10:35 AM, 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.
>>
>> Signed-off-by: Preeti U Murthy <preeti@linux.vnet.ibm.com>
>> ---
>
> Acked-by: Deepthi Dharwar <deepthi@linux.vnet.ibm.com>
>
> Preeti, I will include this patch as part of the pseries cpuidle driver
> clean-ups series which I have undertaken.
Yes that would be great, thanks!
Regards
Preeti U Murthy
>
> Regards,
> Deepthi
>
>> 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 <asm/reg.h>
>> #include <asm/machdep.h>
>> #include <asm/firmware.h>
>> -#include <asm/runlatch.h>
>> #include <asm/plpar_wrappers.h>
>>
>> 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();
>>
>>
>> _______________________________________________
>> Linuxppc-dev mailing list
>> Linuxppc-dev@lists.ozlabs.org
>> https://lists.ozlabs.org/listinfo/linuxppc-dev
>>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] pseries/cpuidle: Remove redundant call to ppc64_runlatch_off() in cpu idle routines
2014-01-09 5:05 [PATCH] pseries/cpuidle: Remove redundant call to ppc64_runlatch_off() in cpu idle routines Preeti U Murthy
2014-01-09 8:07 ` Srivatsa S. Bhat
2014-01-13 3:57 ` Deepthi Dharwar
@ 2014-01-13 5:38 ` Michael Ellerman
2014-01-13 6:34 ` Preeti U Murthy
2 siblings, 1 reply; 6+ messages in thread
From: Michael Ellerman @ 2014-01-13 5:38 UTC (permalink / raw)
To: Preeti U Murthy; +Cc: linuxppc-dev, paulus, deepthi
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] pseries/cpuidle: Remove redundant call to ppc64_runlatch_off() in cpu idle routines
2014-01-13 5:38 ` Michael Ellerman
@ 2014-01-13 6:34 ` Preeti U Murthy
0 siblings, 0 replies; 6+ messages in thread
From: Preeti U Murthy @ 2014-01-13 6:34 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev, paulus, deepthi
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 <preeti@linux.vnet.ibm.com>
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 <preeti@linux.vnet.ibm.com>
---
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 <asm/reg.h>
#include <asm/machdep.h>
#include <asm/firmware.h>
-#include <asm/runlatch.h>
#include <asm/plpar_wrappers.h>
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
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-01-13 6:38 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-09 5:05 [PATCH] pseries/cpuidle: Remove redundant call to ppc64_runlatch_off() in cpu idle routines Preeti U Murthy
2014-01-09 8:07 ` Srivatsa S. Bhat
2014-01-13 3:57 ` Deepthi Dharwar
2014-01-13 4:22 ` Preeti U Murthy
2014-01-13 5:38 ` Michael Ellerman
2014-01-13 6:34 ` Preeti U Murthy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).