<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/vhost, branch v3.2.38</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/drivers/vhost?h=v3.2.38</id>
<link rel='self' href='https://git.amat.us/linux/atom/drivers/vhost?h=v3.2.38'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2012-10-30T23:27:00Z</updated>
<entry>
<title>vhost: fix mergeable bufs on BE hosts</title>
<updated>2012-10-30T23:27:00Z</updated>
<author>
<name>Michael S. Tsirkin</name>
<email>mst@redhat.com</email>
</author>
<published>2012-10-24T18:37:51Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e18dbfae927d33d746f6bf8b14f2d030c12b3ba7'/>
<id>urn:sha1:e18dbfae927d33d746f6bf8b14f2d030c12b3ba7</id>
<content type='text'>
commit 910a578f7e9400a78a3b13aba0b4d2df16a2cb05 upstream.

We copy head count to a 16 bit field, this works by chance on LE but on
BE guest gets 0. Fix it up.

Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Tested-by: Alexander Graf &lt;agraf@suse.de&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>vhost: don't forget to schedule()</title>
<updated>2012-07-25T03:11:38Z</updated>
<author>
<name>Nadav Har'El</name>
<email>nyh@math.technion.ac.il</email>
</author>
<published>2012-02-27T13:07:29Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=1803c9c9746dd5cd524d6499ca24cbb4eacffa37'/>
<id>urn:sha1:1803c9c9746dd5cd524d6499ca24cbb4eacffa37</id>
<content type='text'>
commit d550dda192c1bd039afb774b99485e88b70d7cb8 upstream.

This is a tiny, but important, patch to vhost.

Vhost's worker thread only called schedule() when it had no work to do, and
it wanted to go to sleep. But if there's always work to do, e.g., the guest
is running a network-intensive program like netperf with small message sizes,
schedule() was *never* called. This had several negative implications (on
non-preemptive kernels):

 1. Passing time was not properly accounted to the "vhost" process (ps and
    top would wrongly show it using zero CPU time).

 2. Sometimes error messages about RCU timeouts would be printed, if the
    core running the vhost thread didn't schedule() for a very long time.

 3. Worst of all, a vhost thread would "hog" the core. If several vhost
    threads need to share the same core, typically one would get most of the
    CPU time (and its associated guest most of the performance), while the
    others hardly get any work done.

The trivial solution is to add

	if (need_resched())
		schedule();

After doing every piece of work. This will not do the heavy schedule() all
the time, just when the timer interrupt decided a reschedule is warranted
(so need_resched returns true).

Thanks to Abel Gordon for this patch.

Signed-off-by: Nadav Har'El &lt;nyh@il.ibm.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>atomic: use &lt;linux/atomic.h&gt;</title>
<updated>2011-07-26T23:49:47Z</updated>
<author>
<name>Arun Sharma</name>
<email>asharma@fb.com</email>
</author>
<published>2011-07-26T23:09:06Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=60063497a95e716c9a689af3be2687d261f115b4'/>
<id>urn:sha1:60063497a95e716c9a689af3be2687d261f115b4</id>
<content type='text'>
This allows us to move duplicated code in &lt;asm/atomic.h&gt;
(atomic_inc_not_zero() for now) to &lt;linux/atomic.h&gt;

Signed-off-by: Arun Sharma &lt;asharma@fb.com&gt;
Reviewed-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: David Miller &lt;davem@davemloft.net&gt;
Cc: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Acked-by: Mike Frysinger &lt;vapier@gentoo.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>vhost: handle wrap around in # of bufs math</title>
<updated>2011-07-21T07:48:27Z</updated>
<author>
<name>Shirley Ma</name>
<email>mashirle@us.ibm.com</email>
</author>
<published>2011-07-20T17:23:12Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=9e380825ab3f5176f65306c4ac119fd23634ce03'/>
<id>urn:sha1:9e380825ab3f5176f65306c4ac119fd23634ce03</id>
<content type='text'>
The meth for calculating the # of outstanding buffers gives
incorrect results when vq-&gt;upend_idx wraps around zero.
Fix that.

Signed-off-by: Shirley Ma &lt;xma@us.ibm.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>vhost-net: update used ring on backend change</title>
<updated>2011-07-21T07:23:31Z</updated>
<author>
<name>Michael S. Tsirkin</name>
<email>mst@redhat.com</email>
</author>
<published>2011-07-20T10:41:31Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=c047e5f3170c2595e66ed67f87cec01afd717212'/>
<id>urn:sha1:c047e5f3170c2595e66ed67f87cec01afd717212</id>
<content type='text'>
On backend change, we flushed out outstanding skbs
but forgot to update the used ring, so that
done entries were left in the ubuf_info ring.
As a result we lose heads or complete incorrect ones,
crashing the guest or leaking memory.
Fix by updating the used ring.

Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>vhost: optimize interrupt enable/disable</title>
<updated>2011-07-19T14:17:28Z</updated>
<author>
<name>Michael S. Tsirkin</name>
<email>mst@redhat.com</email>
</author>
<published>2011-07-19T14:15:43Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b834226b04d6fb51178a64e98872856986c71474'/>
<id>urn:sha1:b834226b04d6fb51178a64e98872856986c71474</id>
<content type='text'>
As we now only update used ring after enabling
the backend, we can write flags with __put_user:
as that's done on data path, it matters.

Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>vhost: fix zcopy reference counting</title>
<updated>2011-07-19T10:28:34Z</updated>
<author>
<name>Michael S. Tsirkin</name>
<email>mst@redhat.com</email>
</author>
<published>2011-07-19T10:19:18Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=75fd9edc1054a1fa1d1411adec368dadf68e764e'/>
<id>urn:sha1:75fd9edc1054a1fa1d1411adec368dadf68e764e</id>
<content type='text'>
Fix get/put refcount imbalance with zero copy,
which caused qemu to hang forever on guest driver unload.

Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>vhost: set log when updating used flags or avail event</title>
<updated>2011-07-19T10:28:34Z</updated>
<author>
<name>Jason Wang</name>
<email>jasowang@redhat.com</email>
</author>
<published>2011-06-21T10:04:38Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2723feaa8ec64f677f644c9189ed87d83f5559c1'/>
<id>urn:sha1:2723feaa8ec64f677f644c9189ed87d83f5559c1</id>
<content type='text'>
We need to log writes when updating used flags and avail event
fields.  Otherwise the guest may see a stale value after migration and
miss notifying the host.

Signed-off-by: Jason Wang &lt;jasowang@redhat.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>vhost: init used ring after backend was set</title>
<updated>2011-07-19T10:28:34Z</updated>
<author>
<name>Jason Wang</name>
<email>jasowang@redhat.com</email>
</author>
<published>2011-06-21T10:04:27Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f59281dafb832b161133743fcf3dc29051e6fdb8'/>
<id>urn:sha1:f59281dafb832b161133743fcf3dc29051e6fdb8</id>
<content type='text'>
Move the used ring initialization after backend was set. This
makes it possible to disable the backend and tweak the used ring,
then restart. This will also make it possible to log the used ring
write correctly.

Signed-off-by: Jason Wang &lt;jasowang@redhat.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>vhost: vhost TX zero-copy support</title>
<updated>2011-07-18T17:42:32Z</updated>
<author>
<name>Michael S. Tsirkin</name>
<email>mst@redhat.com</email>
</author>
<published>2011-07-18T03:48:46Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=bab632d69ee48a106e779b60cc01adfe80a72807'/>
<id>urn:sha1:bab632d69ee48a106e779b60cc01adfe80a72807</id>
<content type='text'>
&gt;From: Shirley Ma &lt;mashirle@us.ibm.com&gt;

This adds experimental zero copy support in vhost-net,
disabled by default. To enable, set
experimental_zcopytx module option to 1.

This patch maintains the outstanding userspace buffers in the
sequence it is delivered to vhost. The outstanding userspace buffers
will be marked as done once the lower device buffers DMA has finished.
This is monitored through last reference of kfree_skb callback. Two
buffer indices are used for this purpose.

The vhost-net device passes the userspace buffers info to lower device
skb through message control. DMA done status check and guest
notification are handled by handle_tx: in the worst case is all buffers
in the vq are in pending/done status, so we need to notify guest to
release DMA done buffers first before we get any new buffers from the
vq.

One known problem is that if the guest stops submitting
buffers, buffers might never get used until some
further action, e.g. device reset. This does not
seem to affect linux guests.

Signed-off-by: Shirley &lt;xma@us.ibm.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
