Re: [PATCH v2 0/4] misc fixes on halt-poll code both KVM and guest

From: Rafael J. Wysocki
Date: Wed Nov 06 2019 - 06:06:00 EST


On 11/6/2019 10:08 AM, Zhenzhong Duan wrote:
This patchset tries to fix below issues:

1. Admin could set halt_poll_ns to 0 at runtime to disable poll and kernel
behave just like the generic halt driver. Then If guest_halt_poll_grow_start
is set to 0 and guest_halt_poll_ns set to nonzero later, cpu_halt_poll_us will
never grow beyond 0. The first two patches fix this issue from both kvm and
guest side.

2. guest_halt_poll_grow_start and guest_halt_poll_ns could be adjusted at
runtime by admin, this could make a window where cpu_halt_poll_us jump out
of the boundary. the window could be long in some cases(e.g. guest_halt_poll_grow_start
is bumped and cpu_halt_poll_us is shrinking) The last two patches fix this
issue from both kvm and guest side.

3. The 4th patch also simplifies branch check code.

v2:
Rewrite the patches and drop unnecessory changes

Zhenzhong Duan (4):
cpuidle-haltpoll: ensure grow start value is nonzero
KVM: ensure grow start value is nonzero
cpuidle-haltpoll: ensure cpu_halt_poll_us in right scope
KVM: ensure vCPU halt_poll_us in right scope

drivers/cpuidle/governors/haltpoll.c | 50 ++++++++++++++++++++++++-----------
virt/kvm/kvm_main.c | 51 ++++++++++++++++++++++++------------
2 files changed, 68 insertions(+), 33 deletions(-)

Please resend the series with CCs to linux-pm@xxxxxxxxxxxxxxx, thanks!