aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuraj Jitindar Singh <sjitindarsingh@gmail.com>2016-10-13 20:53:21 -0400
committerPaul Mackerras <paulus@ozlabs.org>2016-11-27 19:48:47 -0500
commite03f3921e597cbcc6880033e5c52fa1db524f88b (patch)
tree70e344307fc50a2a9b477071debfcb9e013cf340
parent307d93e476a340116cbddd1d3d7edf9b3cdd7506 (diff)
KVM: PPC: Book3S HV: Add check for module parameter halt_poll_ns
The kvm module parameter halt_poll_ns defines the global maximum halt polling interval and can be dynamically changed by writing to the /sys/module/kvm/parameters/halt_poll_ns sysfs file. However in kvm-hv this module parameter value is only ever checked when we grow the current polling interval for the given vcore. This means that if we decrease the halt_poll_ns value below the current polling interval we won't see any effect unless we try to grow the polling interval above the new max at some point or it happens to be shrunk below the halt_poll_ns value. Update the halt polling code so that we always check for a new module param value of halt_poll_ns and set the current halt polling interval to it if it's currently greater than the new max. This means that it's redundant to also perform this check in the grow_halt_poll_ns() function now. Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com> Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
-rw-r--r--arch/powerpc/kvm/book3s_hv.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
index f0d22ced3e1f..0b0ca272a13c 100644
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -2599,9 +2599,6 @@ static void grow_halt_poll_ns(struct kvmppc_vcore *vc)
2599 vc->halt_poll_ns = 10000; 2599 vc->halt_poll_ns = 10000;
2600 else 2600 else
2601 vc->halt_poll_ns *= halt_poll_ns_grow; 2601 vc->halt_poll_ns *= halt_poll_ns_grow;
2602
2603 if (vc->halt_poll_ns > halt_poll_ns)
2604 vc->halt_poll_ns = halt_poll_ns;
2605} 2602}
2606 2603
2607static void shrink_halt_poll_ns(struct kvmppc_vcore *vc) 2604static void shrink_halt_poll_ns(struct kvmppc_vcore *vc)
@@ -2721,6 +2718,8 @@ out:
2721 else if (vc->halt_poll_ns < halt_poll_ns && 2718 else if (vc->halt_poll_ns < halt_poll_ns &&
2722 block_ns < halt_poll_ns) 2719 block_ns < halt_poll_ns)
2723 grow_halt_poll_ns(vc); 2720 grow_halt_poll_ns(vc);
2721 if (vc->halt_poll_ns > halt_poll_ns)
2722 vc->halt_poll_ns = halt_poll_ns;
2724 } else 2723 } else
2725 vc->halt_poll_ns = 0; 2724 vc->halt_poll_ns = 0;
2726 2725