Skip to contentSkip to conversation

powerpc/pseries/cpuidle: add polling idle for shared processor guests

PATCH Applied Nicholas Piggin 2 participants 4 messages Oct 10, 2017 – Jan 22, 2018

Subsystems (2)
lore
Share & tools
lore

Nicholas Piggin

author reviewer
#0 lore raw

PATCH 1/1 powerpc/pseries/cpuidle: add polling idle for shared processor guests

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.

---
 drivers/cpuidle/cpuidle-pseries.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/cpuidle/cpuidle-pseries.c +8 -2
index e9b3853d93ea..16be7ad30fe1 100644
@@ -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 },
 };
 
Signature · 1 line
2.13.3
author reviewer
#1 lore raw
Quoted 7 lines · On Tue, 10 Oct 2017 17:11:09 +1000 Nicholas Piggin <[email protected]> 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

author reviewer
#2 lore raw
In reply to Nicholas Piggin
Quoted 11 lines · On Tue, 10 Oct 2017 17:11:09 +1000 Nicholas Piggin <[email protected]> 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.

What should we do about this one?

Quoted 28 lines
---
 drivers/cpuidle/cpuidle-pseries.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/cpuidle/cpuidle-pseries.c +8 -2
index e9b3853d93ea..16be7ad30fe1 100644
@@ -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 },
 };
 
#3 lore raw
In reply to Nicholas Piggin
Quoted 11 lines · Nicholas Piggin

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.

Applied to powerpc next, thanks.

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

cheers