From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sean Christopherson Date: Mon, 27 Sep 2021 15:15:53 +0000 Subject: Re: disabling halt polling broken? (was Re: [PATCH 00/14] KVM: Halt-polling fixes, cleanups and a ne Message-Id: List-Id: References: <20210925005528.1145584-1-seanjc@google.com> <03f2f5ab-e809-2ba5-bd98-3393c3b843d2@de.ibm.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Paolo Bonzini Cc: Christian Borntraeger , David Matlack , Jon Cargille , Jim Mattson , James Morse , Alexandru Elisei , Suzuki K Poulose , David Hildenbrand , Cornelia Huck , Claudio Imbrenda , Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-mips@vger.kernel.org, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, linux-kernel@vger.kernel.org, Jing Zhang , Marc Zyngier , Huacai Chen , Aleksandar Markovic , Paul Mackerras , Janosch Frank On Mon, Sep 27, 2021, Paolo Bonzini wrote: > On 27/09/21 16:59, Sean Christopherson wrote: > > > commit acd05785e48c01edb2c4f4d014d28478b5f19fb5 > > > Author: David Matlack > > > AuthorDate: Fri Apr 17 15:14:46 2020 -0700 > > > Commit: Paolo Bonzini > > > CommitDate: Fri Apr 24 12:53:17 2020 -0400 > > > > > > kvm: add capability for halt polling > > > > > > broke the possibility for an admin to disable halt polling for already running KVM guests. > > > In past times doing > > > echo 0 > /sys/module/kvm/parameters/halt_poll_ns > > > > > > stopped polling system wide. > > > Now all KVM guests will use the halt_poll_ns value that was active during > > > startup - even those that do not use KVM_CAP_HALT_POLL. > > > > > > I guess this was not intended? > > No, but... > > > I would go so far as to say that halt_poll_ns should be a hard limit on > > the capability > > ... this would not be a good idea I think. Anything that wants to do a lot > of polling can just do "for (;;)". Hmm, true, there is no danger to the system in having the capability override the module param. > So I think there are two possibilities that makes sense: > > * track what is using KVM_CAP_HALT_POLL, and make writes to halt_poll_ns > follow that I think this option makes more sense, making halt_poll_ns read-only is basically forcing users to switch to KVM_CAP_HALT_POLL. > * just make halt_poll_ns read-only. > > Paolo >