Bug 1746282

Summary: qemu-kvm: backport cpuidle-haltpoll support [rhel-7.7.z]
Product: Red Hat Enterprise Linux 7 Reporter: RAD team bot copy to z-stream <autobot-eus-copy>
Component: qemu-kvm-rhevAssignee: Marcelo Tosatti <mtosatti>
Status: CLOSED ERRATA QA Contact: jingzhao <jinzhao>
Severity: unspecified Docs Contact:
Priority: high    
Version: 7.8CC: chayang, hhuang, jinzhao, juzhang, mrezanin, mtessun, mtosatti, virt-maint
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qemu-kvm-rhev-2.12.0-33.el7_7.3 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1734502 Environment:
Last Closed: 2019-10-22 15:24:05 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1734502, 1759283    
Bug Blocks:    
Attachments:
Description Flags
dmesg log of guest none

Description RAD team bot copy to z-stream 2019-08-28 07:26:03 UTC
This bug has been copied from bug #1734502 and has been proposed to be backported to 7.7 z-stream (EUS).

Comment 8 jingzhao 2019-09-25 06:29:18 UTC
Created attachment 1618874 [details]
dmesg log of guest

Comment 16 errata-xmlrpc 2019-10-22 15:24:05 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2019:3179

Comment 17 Marcelo Tosatti 2019-12-11 21:48:00 UTC
Rationale for cpuidle haltpoll driver and usage instructions:

That for baremetal systems, when a CPU waits for a certain event, 
such as a waitqueue notification, the kernel implements this as 
a "mwait" instruction based wait (waiter). This avoids the CPU that wakes
the waiter from sending an IPI (and waiter from processing that IPI).
That can have a significant performance impact (up to 10%) if the 
application is multithreaded, the threads communicate with each
other, and sleep for short intervals of time.

The mwait instruction can't be emulated on KVM easily: so instead
the haltpoll driver busy spins for a specified amount of time 
when a guest vCPU halts.

To enable the driver in a guest, the user has to:

1) Enable the kvm-poll-control CPU flag for the emulated vCPU. For
example, if using qemu directly the relevant command line section 
would be (libvirt configuration should be mentioned):

-cpu SandyBridge,tsc-deadline=on,pmu=off,vmx=off,kvm-poll-control=on

2) Load the cpuidle-haltpoll driver in the guest persistently ("PERSISTENT MODULE LOADING" section of RHEL documentation).

3) Tune the guest_halt_poll_ns module parameter: should be slightly larger
than the average delay the application in question performs. Suggest to benchmark
the app while increasing/decreasing guest_halt_poll_ns.