LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [GIT PULL] cpuidle: 4.0-rc3 fixes
@ 2015-03-13 17:42 Daniel Lezcano
  2015-03-13 17:43 ` [PATCH 1/2] cpuidle: mvebu: Fix the CPU PM notifier usage Daniel Lezcano
  2015-03-13 21:56 ` [GIT PULL] cpuidle: 4.0-rc3 fixes Rafael J. Wysocki
  0 siblings, 2 replies; 8+ messages in thread
From: Daniel Lezcano @ 2015-03-13 17:42 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Sebastien Rannou, Gregory Clement, Linux Kernel Mailing List, linux-pm


Hi Rafael,

this pull request contains a couple of fixes:

  - Fix the cpu_pm_enter/exit symmetry in the mvebu driver (Gregory Clement)

  - Fix the mvebu drivers latency/residency values to reach an 
acceptable tradeoff between perf / power (Sebastian Rannou)

Thanks !

   -- Daniel

ps: I took the opportunity to double check the other drivers have their 
cpu_pm_entry/exit symmetry correct (everything ok).


The following changes since commit 9eccca0843205f87c00404b663188b88eb248051:

   Linux 4.0-rc3 (2015-03-08 16:09:09 -0700)

are available in the git repository at:

   http://git.linaro.org/people/daniel.lezcano/linux.git cpuidle/4.0-fixes

for you to fetch changes up to ce6031c89a35cffd5a5992b08377b77f49a004b9:

   cpuidle: mvebu: Update cpuidle thresholds for Armada XP SOCs 
(2015-03-13 18:31:29 +0100)

----------------------------------------------------------------
Gregory CLEMENT (1):
       cpuidle: mvebu: Fix the CPU PM notifier usage

Sebastien Rannou (1):
       cpuidle: mvebu: Update cpuidle thresholds for Armada XP SOCs

  drivers/cpuidle/cpuidle-mvebu-v7.c | 12 ++++++------
  1 file changed, 6 insertions(+), 6 deletions(-)

-- 
  <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/2] cpuidle: mvebu: Fix the CPU PM notifier usage
  2015-03-13 17:42 [GIT PULL] cpuidle: 4.0-rc3 fixes Daniel Lezcano
@ 2015-03-13 17:43 ` Daniel Lezcano
  2015-03-13 17:43   ` [PATCH 2/2] cpuidle: mvebu: Update cpuidle thresholds for Armada XP SOCs Daniel Lezcano
  2015-03-13 21:56 ` [GIT PULL] cpuidle: 4.0-rc3 fixes Rafael J. Wysocki
  1 sibling, 1 reply; 8+ messages in thread
From: Daniel Lezcano @ 2015-03-13 17:43 UTC (permalink / raw)
  To: rjw; +Cc: mxs, gregory.clement, linux-kernel, linux-pm

From: Gregory CLEMENT <gregory.clement@free-electrons.com>

As stated in kernel/cpu_pm.c, "Platform is responsible for ensuring
that cpu_pm_enter is not called twice on the same CPU before
cpu_pm_exit is called.". In the current code in case of failure when
calling mvebu_v7_cpu_suspend, the function cpu_pm_exit() is never
called whereas cpu_pm_enter() was called just before.

This patch moves the cpu_pm_exit() in order to balance the
cpu_pm_enter() calls.

Cc: stable@vger.kernel.org
Reported-by: Fulvio Benini <fbf@libero.it>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/cpuidle/cpuidle-mvebu-v7.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/cpuidle/cpuidle-mvebu-v7.c b/drivers/cpuidle/cpuidle-mvebu-v7.c
index 38e6861..cefa074 100644
--- a/drivers/cpuidle/cpuidle-mvebu-v7.c
+++ b/drivers/cpuidle/cpuidle-mvebu-v7.c
@@ -37,11 +37,11 @@ static int mvebu_v7_enter_idle(struct cpuidle_device *dev,
 		deepidle = true;
 
 	ret = mvebu_v7_cpu_suspend(deepidle);
+	cpu_pm_exit();
+
 	if (ret)
 		return ret;
 
-	cpu_pm_exit();
-
 	return index;
 }
 
-- 
1.9.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 2/2] cpuidle: mvebu: Update cpuidle thresholds for Armada XP SOCs
  2015-03-13 17:43 ` [PATCH 1/2] cpuidle: mvebu: Fix the CPU PM notifier usage Daniel Lezcano
@ 2015-03-13 17:43   ` Daniel Lezcano
  0 siblings, 0 replies; 8+ messages in thread
From: Daniel Lezcano @ 2015-03-13 17:43 UTC (permalink / raw)
  To: rjw; +Cc: mxs, gregory.clement, linux-kernel, linux-pm

From: Sebastien Rannou <mxs@sbrk.org>

Originally, the thresholds used in the cpuidle driver for Armada SOCs
were temporarily chosen, leaving room for improvements.

This commit updates the thresholds for the Armada XP SOCs with values
that positively impact performances:

                                without patch  with patch   vendor kernel
 - iperf localhost (gbit/sec)   ~3.7           ~6.4         ~5.4
 - ioping tmpfs (iops)          ~163k          ~206k        ~179k
 - ioping tmpfs (mib/s)         ~636           ~805         ~699

The idle power consumption is negatively impacted (proportionally less
than the performance gain), and we are still performing better than
the vendor kernel here:

                                without patch   with patch  vendor kernel
 - power consumption idle (W)   ~2.4            ~3.2        ~4.4
 - power consumption busy (W)   ~8.6            ~8.3        ~8.6

There is still room for improvement regarding the value of these
thresholds, they were chosen to mimic the vendor kernel.

This patch only impacts Armada XP SOCs and was tested on Online Labs
C1 boards. A similar approach can be taken to improve the performances
of the Armada 370 and Armada 38x SOCs.

Thanks a lot to Thomas Petazzoni, Gregory Clement and Willy Tarreau
for the discussions and tips around this topic.

Signed-off-by: Sebastien Rannou <mxs@sbrk.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
---
 drivers/cpuidle/cpuidle-mvebu-v7.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/cpuidle/cpuidle-mvebu-v7.c b/drivers/cpuidle/cpuidle-mvebu-v7.c
index cefa074..980151f 100644
--- a/drivers/cpuidle/cpuidle-mvebu-v7.c
+++ b/drivers/cpuidle/cpuidle-mvebu-v7.c
@@ -50,17 +50,17 @@ static struct cpuidle_driver armadaxp_idle_driver = {
 	.states[0]		= ARM_CPUIDLE_WFI_STATE,
 	.states[1]		= {
 		.enter			= mvebu_v7_enter_idle,
-		.exit_latency		= 10,
+		.exit_latency		= 100,
 		.power_usage		= 50,
-		.target_residency	= 100,
+		.target_residency	= 1000,
 		.name			= "MV CPU IDLE",
 		.desc			= "CPU power down",
 	},
 	.states[2]		= {
 		.enter			= mvebu_v7_enter_idle,
-		.exit_latency		= 100,
+		.exit_latency		= 1000,
 		.power_usage		= 5,
-		.target_residency	= 1000,
+		.target_residency	= 10000,
 		.flags			= MVEBU_V7_FLAG_DEEP_IDLE,
 		.name			= "MV CPU DEEP IDLE",
 		.desc			= "CPU and L2 Fabric power down",
-- 
1.9.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [GIT PULL] cpuidle: 4.0-rc3 fixes
  2015-03-13 21:56 ` [GIT PULL] cpuidle: 4.0-rc3 fixes Rafael J. Wysocki
@ 2015-03-13 21:38   ` Daniel Lezcano
  2015-03-16  9:24   ` Geert Uytterhoeven
  1 sibling, 0 replies; 8+ messages in thread
From: Daniel Lezcano @ 2015-03-13 21:38 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Sebastien Rannou, Gregory Clement, Linux Kernel Mailing List,
	Linux PM list

On 03/13/2015 10:56 PM, Rafael J. Wysocki wrote:
> On Friday, March 13, 2015 06:42:30 PM Daniel Lezcano wrote:
>>
>> Hi Rafael,
>>
>> this pull request contains a couple of fixes:
>>
>>    - Fix the cpu_pm_enter/exit symmetry in the mvebu driver (Gregory Clement)
>>
>>    - Fix the mvebu drivers latency/residency values to reach an
>> acceptable tradeoff between perf / power (Sebastian Rannou)
>>
>> Thanks !
>
> Pulled, but this is a bit too late for 4.0-rc4, so I'll queue it up for -rc5.

Ok, no problem.

>> ps: I took the opportunity to double check the other drivers have their
>> cpu_pm_entry/exit symmetry correct (everything ok).
>
> OK, thanks!
>
> BTW, please update the dead linux-pm address you have in your scripts.

Fixed. Thanks for the head up.

   -- Daniel


-- 
  <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [GIT PULL] cpuidle: 4.0-rc3 fixes
  2015-03-13 17:42 [GIT PULL] cpuidle: 4.0-rc3 fixes Daniel Lezcano
  2015-03-13 17:43 ` [PATCH 1/2] cpuidle: mvebu: Fix the CPU PM notifier usage Daniel Lezcano
@ 2015-03-13 21:56 ` Rafael J. Wysocki
  2015-03-13 21:38   ` Daniel Lezcano
  2015-03-16  9:24   ` Geert Uytterhoeven
  1 sibling, 2 replies; 8+ messages in thread
From: Rafael J. Wysocki @ 2015-03-13 21:56 UTC (permalink / raw)
  To: Daniel Lezcano
  Cc: Sebastien Rannou, Gregory Clement, Linux Kernel Mailing List,
	Linux PM list

On Friday, March 13, 2015 06:42:30 PM Daniel Lezcano wrote:
> 
> Hi Rafael,
> 
> this pull request contains a couple of fixes:
> 
>   - Fix the cpu_pm_enter/exit symmetry in the mvebu driver (Gregory Clement)
> 
>   - Fix the mvebu drivers latency/residency values to reach an 
> acceptable tradeoff between perf / power (Sebastian Rannou)
> 
> Thanks !

Pulled, but this is a bit too late for 4.0-rc4, so I'll queue it up for -rc5.

> ps: I took the opportunity to double check the other drivers have their 
> cpu_pm_entry/exit symmetry correct (everything ok).

OK, thanks!

BTW, please update the dead linux-pm address you have in your scripts.


-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [GIT PULL] cpuidle: 4.0-rc3 fixes
  2015-03-13 21:56 ` [GIT PULL] cpuidle: 4.0-rc3 fixes Rafael J. Wysocki
  2015-03-13 21:38   ` Daniel Lezcano
@ 2015-03-16  9:24   ` Geert Uytterhoeven
  2015-03-17  2:37     ` Rafael J. Wysocki
  1 sibling, 1 reply; 8+ messages in thread
From: Geert Uytterhoeven @ 2015-03-16  9:24 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Daniel Lezcano, Sebastien Rannou, Gregory Clement,
	Linux Kernel Mailing List, Linux PM list

Hi Rafael,

On Fri, Mar 13, 2015 at 10:56 PM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> On Friday, March 13, 2015 06:42:30 PM Daniel Lezcano wrote:
>> this pull request contains a couple of fixes:
>>
>>   - Fix the cpu_pm_enter/exit symmetry in the mvebu driver (Gregory Clement)
>>
>>   - Fix the mvebu drivers latency/residency values to reach an
>> acceptable tradeoff between perf / power (Sebastian Rannou)
>>
>> Thanks !
>
> Pulled, but this is a bit too late for 4.0-rc4, so I'll queue it up for -rc5.

Please note commit 43b68879de27b199 ("cpuidle: mvebu: Fix the CPU PM
notifier usage") has a "Cc: stable@vger.kernel.org" tag.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [GIT PULL] cpuidle: 4.0-rc3 fixes
  2015-03-16  9:24   ` Geert Uytterhoeven
@ 2015-03-17  2:37     ` Rafael J. Wysocki
  2015-03-17  6:53       ` Geert Uytterhoeven
  0 siblings, 1 reply; 8+ messages in thread
From: Rafael J. Wysocki @ 2015-03-17  2:37 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Daniel Lezcano, Sebastien Rannou, Gregory Clement,
	Linux Kernel Mailing List, Linux PM list

On Monday, March 16, 2015 10:24:27 AM Geert Uytterhoeven wrote:
> Hi Rafael,
> 
> On Fri, Mar 13, 2015 at 10:56 PM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> > On Friday, March 13, 2015 06:42:30 PM Daniel Lezcano wrote:
> >> this pull request contains a couple of fixes:
> >>
> >>   - Fix the cpu_pm_enter/exit symmetry in the mvebu driver (Gregory Clement)
> >>
> >>   - Fix the mvebu drivers latency/residency values to reach an
> >> acceptable tradeoff between perf / power (Sebastian Rannou)
> >>
> >> Thanks !
> >
> > Pulled, but this is a bit too late for 4.0-rc4, so I'll queue it up for -rc5.
> 
> Please note commit 43b68879de27b199 ("cpuidle: mvebu: Fix the CPU PM
> notifier usage") has a "Cc: stable@vger.kernel.org" tag.

Yes, it does, and that's why I've queued it up for 4.0-rc5 and not for 4.1.

Does it require any extra care or something?


-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [GIT PULL] cpuidle: 4.0-rc3 fixes
  2015-03-17  2:37     ` Rafael J. Wysocki
@ 2015-03-17  6:53       ` Geert Uytterhoeven
  0 siblings, 0 replies; 8+ messages in thread
From: Geert Uytterhoeven @ 2015-03-17  6:53 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Daniel Lezcano, Sebastien Rannou, Gregory Clement,
	Linux Kernel Mailing List, Linux PM list

Hi Rafael,

On Tue, Mar 17, 2015 at 3:37 AM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
>> > Pulled, but this is a bit too late for 4.0-rc4, so I'll queue it up for -rc5.
>>
>> Please note commit 43b68879de27b199 ("cpuidle: mvebu: Fix the CPU PM
>> notifier usage") has a "Cc: stable@vger.kernel.org" tag.
>
> Yes, it does, and that's why I've queued it up for 4.0-rc5 and not for 4.1.
>
> Does it require any extra care or something?

Nevermind, I replied too soon after reading "too late for 4.0...".

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-03-17  6:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-13 17:42 [GIT PULL] cpuidle: 4.0-rc3 fixes Daniel Lezcano
2015-03-13 17:43 ` [PATCH 1/2] cpuidle: mvebu: Fix the CPU PM notifier usage Daniel Lezcano
2015-03-13 17:43   ` [PATCH 2/2] cpuidle: mvebu: Update cpuidle thresholds for Armada XP SOCs Daniel Lezcano
2015-03-13 21:56 ` [GIT PULL] cpuidle: 4.0-rc3 fixes Rafael J. Wysocki
2015-03-13 21:38   ` Daniel Lezcano
2015-03-16  9:24   ` Geert Uytterhoeven
2015-03-17  2:37     ` Rafael J. Wysocki
2015-03-17  6:53       ` Geert Uytterhoeven

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).