linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/pseries/cpuidle: add polling idle for shared processor guests
@ 2017-10-10  7:11 Nicholas Piggin
  2017-10-10  9:42 ` Nicholas Piggin
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Nicholas Piggin @ 2017-10-10  7:11 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Nicholas Piggin, kvm-ppc, linux-pm

For shared processor guests (e.g., KVM), add an idle polling mode rather
than immediately returning to the hypervisor when the guest CPU goes
idle.

Test setup is a 2 socket POWER9 with 4 guests running, each with vCPUs
equal to 1/2 of real of CPUs. Saturated each guest with tbench. Using
polling idle gives about 1.4x throughput.

Kernel compile speed was not changed significantly.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 drivers/cpuidle/cpuidle-pseries.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/cpuidle/cpuidle-pseries.c b/drivers/cpuidle/cpuidle-pseries.c
index e9b3853d93ea..16be7ad30fe1 100644
--- a/drivers/cpuidle/cpuidle-pseries.c
+++ b/drivers/cpuidle/cpuidle-pseries.c
@@ -171,11 +171,17 @@ static struct cpuidle_state dedicated_states[] = {
  * States for shared partition case.
  */
 static struct cpuidle_state shared_states[] = {
+	{ /* Snooze */
+		.name = "snooze",
+		.desc = "snooze",
+		.exit_latency = 0,
+		.target_residency = 0,
+		.enter = &snooze_loop },
 	{ /* Shared Cede */
 		.name = "Shared Cede",
 		.desc = "Shared Cede",
-		.exit_latency = 0,
-		.target_residency = 0,
+		.exit_latency = 10,
+		.target_residency = 100,
 		.enter = &shared_cede_loop },
 };
 
-- 
2.13.3

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

* Re: [PATCH] powerpc/pseries/cpuidle: add polling idle for shared processor guests
  2017-10-10  7:11 [PATCH] powerpc/pseries/cpuidle: add polling idle for shared processor guests Nicholas Piggin
@ 2017-10-10  9:42 ` Nicholas Piggin
  2017-11-16 16:17 ` Nicholas Piggin
  2018-01-22  3:34 ` Michael Ellerman
  2 siblings, 0 replies; 4+ messages in thread
From: Nicholas Piggin @ 2017-10-10  9:42 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: kvm-ppc, linux-pm

On Tue, 10 Oct 2017 17:11:09 +1000
Nicholas Piggin <npiggin@gmail.com> wrote:

> For shared processor guests (e.g., KVM), add an idle polling mode rather
> than immediately returning to the hypervisor when the guest CPU goes
> idle.
> 
> Test setup is a 2 socket POWER9 with 4 guests running, each with vCPUs
> equal to 1/2 of real of CPUs. Saturated each guest with tbench. Using
> polling idle gives about 1.4x throughput.

Actually it's even more noticeable when the host is not over subscribed
by the looks. 2.5x-3x increase in throughput for just a single guest.

Thanks,
Nick

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

* Re: [PATCH] powerpc/pseries/cpuidle: add polling idle for shared processor guests
  2017-10-10  7:11 [PATCH] powerpc/pseries/cpuidle: add polling idle for shared processor guests Nicholas Piggin
  2017-10-10  9:42 ` Nicholas Piggin
@ 2017-11-16 16:17 ` Nicholas Piggin
  2018-01-22  3:34 ` Michael Ellerman
  2 siblings, 0 replies; 4+ messages in thread
From: Nicholas Piggin @ 2017-11-16 16:17 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: kvm-ppc, linux-pm

On Tue, 10 Oct 2017 17:11:09 +1000
Nicholas Piggin <npiggin@gmail.com> wrote:

> For shared processor guests (e.g., KVM), add an idle polling mode rather
> than immediately returning to the hypervisor when the guest CPU goes
> idle.
> 
> Test setup is a 2 socket POWER9 with 4 guests running, each with vCPUs
> equal to 1/2 of real of CPUs. Saturated each guest with tbench. Using
> polling idle gives about 1.4x throughput.
> 
> Kernel compile speed was not changed significantly.
> 
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>

What should we do about this one?


> ---
>  drivers/cpuidle/cpuidle-pseries.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/cpuidle/cpuidle-pseries.c b/drivers/cpuidle/cpuidle-pseries.c
> index e9b3853d93ea..16be7ad30fe1 100644
> --- a/drivers/cpuidle/cpuidle-pseries.c
> +++ b/drivers/cpuidle/cpuidle-pseries.c
> @@ -171,11 +171,17 @@ static struct cpuidle_state dedicated_states[] = {
>   * States for shared partition case.
>   */
>  static struct cpuidle_state shared_states[] = {
> +	{ /* Snooze */
> +		.name = "snooze",
> +		.desc = "snooze",
> +		.exit_latency = 0,
> +		.target_residency = 0,
> +		.enter = &snooze_loop },
>  	{ /* Shared Cede */
>  		.name = "Shared Cede",
>  		.desc = "Shared Cede",
> -		.exit_latency = 0,
> -		.target_residency = 0,
> +		.exit_latency = 10,
> +		.target_residency = 100,
>  		.enter = &shared_cede_loop },
>  };
>  

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

* Re: powerpc/pseries/cpuidle: add polling idle for shared processor guests
  2017-10-10  7:11 [PATCH] powerpc/pseries/cpuidle: add polling idle for shared processor guests Nicholas Piggin
  2017-10-10  9:42 ` Nicholas Piggin
  2017-11-16 16:17 ` Nicholas Piggin
@ 2018-01-22  3:34 ` Michael Ellerman
  2 siblings, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2018-01-22  3:34 UTC (permalink / raw)
  To: Nicholas Piggin, linuxppc-dev; +Cc: kvm-ppc, Nicholas Piggin, linux-pm

On Tue, 2017-10-10 at 07:11:09 UTC, Nicholas Piggin wrote:
> For shared processor guests (e.g., KVM), add an idle polling mode rather
> than immediately returning to the hypervisor when the guest CPU goes
> idle.
> 
> Test setup is a 2 socket POWER9 with 4 guests running, each with vCPUs
> equal to 1/2 of real of CPUs. Saturated each guest with tbench. Using
> polling idle gives about 1.4x throughput.
> 
> Kernel compile speed was not changed significantly.
> 
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/f2ac428e0edabbca41b9dfe9473a90

cheers

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

end of thread, other threads:[~2018-01-22  3:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-10  7:11 [PATCH] powerpc/pseries/cpuidle: add polling idle for shared processor guests Nicholas Piggin
2017-10-10  9:42 ` Nicholas Piggin
2017-11-16 16:17 ` Nicholas Piggin
2018-01-22  3:34 ` Michael Ellerman

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