qemu: domain I/O asynchronous handling

For virtio disks and interfaces, qemu allows users to enable or disable
ioeventfd feature. This means, qemu can execute domain code, while
another thread waits for I/O event. Basically, in some cases it is win,
in some loss. This feature is available via 'ioeventfd' attribute in disk
and interface <driver> element. It accepts 'on' and 'off'. Leaving this
attribute out defaults to hypervisor decision.
This commit is contained in:
Michal Privoznik
2011-06-20 10:26:47 +02:00
parent 1486099cca
commit 017abcbb1a
12 changed files with 191 additions and 4 deletions

View File

@@ -785,7 +785,7 @@
&lt;/disk&gt;
...
&lt;disk type='network'&gt;
&lt;driver name="qemu" type="raw" io="threads"/&gt;
&lt;driver name="qemu" type="raw" io="threads" ioeventfd="on"/&gt;
&lt;source protocol="sheepdog" name="image_name"&gt;
&lt;host name="hostname" port="7000"/&gt;
&lt;/source&gt;
@@ -869,6 +869,20 @@
policies on I/O; qemu guests support "threads" and
"native". <span class="since">Since 0.8.8</span>
</li>
<li>
The optional <code>ioeventfd</code> attribute allows users to
set <a href='https://patchwork.kernel.org/patch/43390/'>
domain I/O asynchronous handling</a> for disk device.
The default is left to the discretion of the hypervisor.
Accepted values are "on" and "off". Enabling this allows
qemu to execute VM while a separate thread handles I/O.
Typically guests experiencing high system CPU utilization
during I/O will benefit from this. On the other hand,
on overloaded host it could increase guest I/O latency.
<span class="since">Since 0.9.3 (QEMU and KVM only)</span>
<b>In general you should leave this option alone, unless you
are very certain you know what you are doing.</b>
</li>
</ul>
</dd>
<dt><code>boot</code></dt>
@@ -1649,7 +1663,7 @@ qemu-kvm -net nic,model=? /dev/null
&lt;source network='default'/&gt;
&lt;target dev='vnet1'/&gt;
&lt;model type='virtio'/&gt;
<b>&lt;driver name='vhost' txmode='iothread'/&gt;</b>
<b>&lt;driver name='vhost' txmode='iothread' ioeventfd='on'/&gt;</b>
&lt;/interface&gt;
&lt;/devices&gt;
...</pre>
@@ -1697,6 +1711,22 @@ qemu-kvm -net nic,model=? /dev/null
contention since the cpu doing the tx isn't necessarily the
cpu where the guest generated the packets."<br/><br/>
<b>In general you should leave this option alone, unless you
are very certain you know what you are doing.</b>
</dd>
<dt><code>ioeventfd</code></dt>
<dd>
This optional attribute allows users to set
<a href='https://patchwork.kernel.org/patch/43390/'>
domain I/O asynchronous handling</a> for interface device.
The default is left to the discretion of the hypervisor.
Accepted values are "on" and "off". Enabling this allows
qemu to execute VM while a separate thread handles I/O.
Typically guests experiencing high system CPU utilization
during I/O will benefit from this. On the other hand,
on overloaded host it could increase guest I/O latency.
<span class="since">Since 0.9.3 (QEMU and KVM only)</span><br/><br/>
<b>In general you should leave this option alone, unless you
are very certain you know what you are doing.</b>
</dd>

View File

@@ -778,6 +778,9 @@
<optional>
<ref name="driverIO"/>
</optional>
<optional>
<ref name="ioeventfd"/>
</optional>
<empty/>
</element>
</define>
@@ -817,6 +820,14 @@
</choice>
</attribute>
</define>
<define name="ioeventfd">
<attribute name="ioeventfd">
<choice>
<value>on</value>
<value>off</value>
</choice>
</attribute>
</define>
<define name="controller">
<element name="controller">
<choice>
@@ -1117,6 +1128,9 @@
</choice>
</attribute>
</optional>
<optional>
<ref name="ioeventfd"/>
</optional>
<empty/>
</element>
</optional>