Skip to content

Commit

Permalink
powerpc/pseries/cpuidle: add polling idle for shared processor guests
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
  • Loading branch information
Nicholas Piggin authored and Michael Ellerman committed Jan 18, 2018
1 parent ced54c0 commit f2ac428
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions drivers/cpuidle/cpuidle-pseries.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,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 },
};

Expand Down

0 comments on commit f2ac428

Please sign in to comment.