Bug 1404308

Summary: RFE: virtio-blk/scsi polling mode (libvirt)
Product: Red Hat Enterprise Linux 7 Reporter: Ademar Reis <areis>
Component: libvirtAssignee: Pavel Hrdina <phrdina>
Status: CLOSED WONTFIX QA Contact: Han Han <hhan>
Severity: unspecified Docs Contact: Yehuda Zimmerman <yzimmerm>
Priority: high    
Version: 7.0CC: dyuan, lmen, mtessun, rbalakri, stefanha, virt-bugs, virt-maint, xuzhang
Target Milestone: rcKeywords: FutureFeature
Target Release: 7.4   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: 1404303
: 1404318 1404322 (view as bug list) Environment:
Last Closed: 2017-02-21 14:55:44 UTC Type: Bug
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: 1404303    
Bug Blocks: 1395265, 1404318, 1404322    

Description Ademar Reis 2016-12-13 15:10:59 UTC
Clone for libvirt.

+++ This bug was initially created as a clone of Bug #1404303 +++

From the patch over letter:

Recent performance investigation work done by Karl Rister shows that the
guest->host notification takes around 20 us.  This is more than the "overhead"
of QEMU itself (e.g. block layer).

One way to avoid the costly exit is to use polling instead of notification.
The main drawback of polling is that it consumes CPU resources.  In order to
benefit performance the host must have extra CPU cycles available on physical
CPUs that aren't used by the guest.

This is an experimental AioContext polling implementation.  It adds a polling
callback into the event loop.  Polling functions are implemented for virtio-blk
virtqueue guest->host kick and Linux AIO completion.

The -object iothread,poll-max-ns=NUM parameter sets the number of nanoseconds
to poll before entering the usual blocking poll(2) syscall.  Try setting this
parameter to the time from old request completion to new virtqueue kick.  By
default no polling is done so you must set this parameter to get busy polling.

Current patch series (v4):
https://lists.gnu.org/archive/html/qemu-devel/2016-12/msg00148.html

Comment 2 Pavel Hrdina 2017-02-21 14:55:44 UTC
Based on the discussion [1] in upstream we should not do anything in Libvirt and let's QEMU deal with the polling stuff.  QEMU will enable it by default so users usually don't have to care about it.  If someone comes up with good and valid reasons to disable polling we can consider adding that feature into Libvirt.

[1] <https://www.redhat.com/archives/libvir-list/2017-February/msg01084.html>