From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Borntraeger Subject: Re: [PATCH] KVM: halt_polling: allow tuning of grow/shrink Date: Tue, 9 Feb 2016 13:21:10 +0100 Message-ID: <56B9D9B6.2040303@de.ibm.com> References: <1455019243-87616-1-git-send-email-borntraeger@de.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Cc: KVM , Wanpeng Li To: Paolo Bonzini Return-path: Received: from e06smtp08.uk.ibm.com ([195.75.94.104]:44741 "EHLO e06smtp08.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753409AbcBIMVP (ORCPT ); Tue, 9 Feb 2016 07:21:15 -0500 Received: from localhost by e06smtp08.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 9 Feb 2016 12:21:13 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 63BFD17D8056 for ; Tue, 9 Feb 2016 12:21:25 +0000 (GMT) Received: from d06av01.portsmouth.uk.ibm.com (d06av01.portsmouth.uk.ibm.com [9.149.37.212]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u19CLAGj64028746 for ; Tue, 9 Feb 2016 12:21:10 GMT Received: from d06av01.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u19CLAJL022507 for ; Tue, 9 Feb 2016 05:21:10 -0700 In-Reply-To: <1455019243-87616-1-git-send-email-borntraeger@de.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: On 02/09/2016 01:00 PM, Christian Borntraeger wrote: > Right now halt_poll_ns can be change during runtime. The > grow and shrink factors can only be set during module load. > Let's make this consistent and allow changes during runtime. > To avoid dirty tricky like setting shrink to 0 after the > check for 0, use READ_ONCE to get a consistent number for > all cases. > > Cc: Wanpeng Li > Signed-off-by: Christian Borntraeger > --- > virt/kvm/kvm_main.c | 22 ++++++++++++---------- > 1 file changed, 12 insertions(+), 10 deletions(-) > > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c > index 726d7c8..eafea6f 100644 > --- a/virt/kvm/kvm_main.c > +++ b/virt/kvm/kvm_main.c > @@ -72,11 +72,11 @@ module_param(halt_poll_ns, uint, S_IRUGO | S_IWUSR); > > /* Default doubles per-vcpu halt_poll_ns. */ > static unsigned int halt_poll_ns_grow = 2; > -module_param(halt_poll_ns_grow, int, S_IRUGO); > +module_param(halt_poll_ns_grow, int, S_IRUGO | S_IWUSR); Please let me know if I should respin with a global fixup regarding signedness: Right now we have a mix of uint: > static unsigned int halt_poll_ns_grow = 2; int: > +module_param(halt_poll_ns_grow, int, S_IRUGO | S_IWUSR); int: > - int old, val; I think having everything as unsigned int would be the right thing. Christian