aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuraj Jitindar Singh <sjitindarsingh@gmail.com>2016-10-13 20:53:20 -0400
committerPaul Mackerras <paulus@ozlabs.org>2016-11-27 19:48:47 -0500
commit307d93e476a340116cbddd1d3d7edf9b3cdd7506 (patch)
treee435f9f0a751731ab4caab48411a713818b51b24
parentec76d819d27040e418801d1a57bd3bdfde51019e (diff)
KVM: PPC: Book3S HV: Use generic kvm module parameters
The previous patch exported the variables which back the module parameters of the generic kvm module. Now use these variables in the kvm-hv module so that any change to the generic module parameters will also have the same effect for the kvm-hv module. This removes the duplication of the kvm module parameters which was redundant and should reduce confusion when tuning them. 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.c29
1 files changed, 6 insertions, 23 deletions
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
index 7ee77fe88356..f0d22ced3e1f 100644
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -108,23 +108,6 @@ module_param_cb(h_ipi_redirect, &module_param_ops, &h_ipi_redirect,
108MODULE_PARM_DESC(h_ipi_redirect, "Redirect H_IPI wakeup to a free host core"); 108MODULE_PARM_DESC(h_ipi_redirect, "Redirect H_IPI wakeup to a free host core");
109#endif 109#endif
110 110
111/* Maximum halt poll interval defaults to KVM_HALT_POLL_NS_DEFAULT */
112static unsigned int halt_poll_max_ns = KVM_HALT_POLL_NS_DEFAULT;
113module_param(halt_poll_max_ns, uint, S_IRUGO | S_IWUSR);
114MODULE_PARM_DESC(halt_poll_max_ns, "Maximum halt poll time in ns");
115
116/* Factor by which the vcore halt poll interval is grown, default is to double
117 */
118static unsigned int halt_poll_ns_grow = 2;
119module_param(halt_poll_ns_grow, int, S_IRUGO);
120MODULE_PARM_DESC(halt_poll_ns_grow, "Factor halt poll time is grown by");
121
122/* Factor by which the vcore halt poll interval is shrunk, default is to reset
123 */
124static unsigned int halt_poll_ns_shrink;
125module_param(halt_poll_ns_shrink, int, S_IRUGO);
126MODULE_PARM_DESC(halt_poll_ns_shrink, "Factor halt poll time is shrunk by");
127
128static void kvmppc_end_cede(struct kvm_vcpu *vcpu); 111static void kvmppc_end_cede(struct kvm_vcpu *vcpu);
129static int kvmppc_hv_setup_htab_rma(struct kvm_vcpu *vcpu); 112static int kvmppc_hv_setup_htab_rma(struct kvm_vcpu *vcpu);
130 113
@@ -2617,8 +2600,8 @@ static void grow_halt_poll_ns(struct kvmppc_vcore *vc)
2617 else 2600 else
2618 vc->halt_poll_ns *= halt_poll_ns_grow; 2601 vc->halt_poll_ns *= halt_poll_ns_grow;
2619 2602
2620 if (vc->halt_poll_ns > halt_poll_max_ns) 2603 if (vc->halt_poll_ns > halt_poll_ns)
2621 vc->halt_poll_ns = halt_poll_max_ns; 2604 vc->halt_poll_ns = halt_poll_ns;
2622} 2605}
2623 2606
2624static void shrink_halt_poll_ns(struct kvmppc_vcore *vc) 2607static void shrink_halt_poll_ns(struct kvmppc_vcore *vc)
@@ -2728,15 +2711,15 @@ out:
2728 } 2711 }
2729 2712
2730 /* Adjust poll time */ 2713 /* Adjust poll time */
2731 if (halt_poll_max_ns) { 2714 if (halt_poll_ns) {
2732 if (block_ns <= vc->halt_poll_ns) 2715 if (block_ns <= vc->halt_poll_ns)
2733 ; 2716 ;
2734 /* We slept and blocked for longer than the max halt time */ 2717 /* We slept and blocked for longer than the max halt time */
2735 else if (vc->halt_poll_ns && block_ns > halt_poll_max_ns) 2718 else if (vc->halt_poll_ns && block_ns > halt_poll_ns)
2736 shrink_halt_poll_ns(vc); 2719 shrink_halt_poll_ns(vc);
2737 /* We slept and our poll time is too small */ 2720 /* We slept and our poll time is too small */
2738 else if (vc->halt_poll_ns < halt_poll_max_ns && 2721 else if (vc->halt_poll_ns < halt_poll_ns &&
2739 block_ns < halt_poll_max_ns) 2722 block_ns < halt_poll_ns)
2740 grow_halt_poll_ns(vc); 2723 grow_halt_poll_ns(vc);
2741 } else 2724 } else
2742 vc->halt_poll_ns = 0; 2725 vc->halt_poll_ns = 0;