Re: [PATCH] kvm tools: Process virito blk requests in separate thread

2012-06-07 Thread Paolo Bonzini
Il 07/06/2012 03:38, Asias He ha scritto: I never looked at the kvmtool code, but I think Asias has a point. If the guest submits I/O to lots of devices, they would contend on the single thread. There was a similar proof of concept patch for QEMU that provided substantial benefit.

Re: [PATCH] kvm tools: Process virito blk requests in separate thread

2012-06-07 Thread Asias He
On Thu, Jun 7, 2012 at 4:47 PM, Paolo Bonzini pbonz...@redhat.com wrote: Il 07/06/2012 03:38, Asias He ha scritto: I never looked at the kvmtool code, but I think Asias has a point.  If the guest submits I/O to lots of devices, they would contend on the single thread.  There was a similar

Re: [PATCH] kvm tools: Process virito blk requests in separate thread

2012-06-06 Thread Paolo Bonzini
Il 04/06/2012 18:07, Sasha Levin ha scritto: All blk requests are processed in notify_vq() which is in the context of ioeventfd thread: ioeventfd__thread(). The processing in notify_vq() may take a long time to complete and all devices share the single ioeventfd thead, so this might block

Re: [PATCH] kvm tools: Process virito blk requests in separate thread

2012-06-06 Thread Asias He
On Wed, Jun 6, 2012 at 8:35 PM, Paolo Bonzini pbonz...@redhat.com wrote: Il 04/06/2012 18:07, Sasha Levin ha scritto: All blk requests are processed in notify_vq() which is in the context of ioeventfd thread: ioeventfd__thread(). The processing in notify_vq() may take a long time to

Re: [PATCH] kvm tools: Process virito blk requests in separate thread

2012-06-05 Thread Cyrill Gorcunov
On Tue, Jun 05, 2012 at 08:47:17AM +0800, Asias He wrote: I must admit I don't understand this code ;) The data get read into stack variable forever? The data we read itself is not interesting at all. virtio_blk_thread() sleeps on the eventfd bdev-io_efd until notify_vq() writes something

Re: [PATCH] kvm tools: Process virito blk requests in separate thread

2012-06-05 Thread Pekka Enberg
On Tue, Jun 5, 2012 at 4:03 AM, Asias He asias.he...@gmail.com wrote: On Tue, Jun 5, 2012 at 12:07 AM, Sasha Levin levinsasha...@gmail.com wrote: On Mon, 2012-06-04 at 23:40 +0800, Asias He wrote: All blk requests are processed in notify_vq() which is in the context of ioeventfd thread:

[PATCH] kvm tools: Process virito blk requests in separate thread

2012-06-04 Thread Asias He
All blk requests are processed in notify_vq() which is in the context of ioeventfd thread: ioeventfd__thread(). The processing in notify_vq() may take a long time to complete and all devices share the single ioeventfd thead, so this might block other device's notify_vq() being called and starve

Re: [PATCH] kvm tools: Process virito blk requests in separate thread

2012-06-04 Thread Cyrill Gorcunov
On Mon, Jun 04, 2012 at 11:40:53PM +0800, Asias He wrote: +static void *virtio_blk_thread(void *dev) +{ + struct blk_dev *bdev = dev; + u64 data; + + while (1) { + read(bdev-io_efd, data, sizeof(u64)); + virtio_blk_do_io(bdev-kvm, bdev-vqs[0], bdev);

Re: [PATCH] kvm tools: Process virito blk requests in separate thread

2012-06-04 Thread Sasha Levin
On Mon, 2012-06-04 at 23:40 +0800, Asias He wrote: All blk requests are processed in notify_vq() which is in the context of ioeventfd thread: ioeventfd__thread(). The processing in notify_vq() may take a long time to complete and all devices share the single ioeventfd thead, so this might

Re: [PATCH] kvm tools: Process virito blk requests in separate thread

2012-06-04 Thread Asias He
On Mon, Jun 4, 2012 at 11:48 PM, Cyrill Gorcunov gorcu...@openvz.org wrote: On Mon, Jun 04, 2012 at 11:40:53PM +0800, Asias He wrote: +static void *virtio_blk_thread(void *dev) +{ +     struct blk_dev *bdev = dev; +     u64 data; + +     while (1) { +             read(bdev-io_efd, data,

Re: [PATCH] kvm tools: Process virito blk requests in separate thread

2012-06-04 Thread Asias He
On Tue, Jun 5, 2012 at 12:07 AM, Sasha Levin levinsasha...@gmail.com wrote: On Mon, 2012-06-04 at 23:40 +0800, Asias He wrote: All blk requests are processed in notify_vq() which is in the context of ioeventfd thread: ioeventfd__thread(). The processing in notify_vq() may take a long time to

Re: [PATCH] kvm tools: Process virito blk requests in separate thread

2011-12-01 Thread Pekka Enberg
On Wed, 30 Nov 2011, Asias He wrote: In virtio net's notify_vq(), we simply signal the tx/rx handle thread and return. Why not use the threadpool? No. Sasha? -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo

Re: [PATCH] kvm tools: Process virito blk requests in separate thread

2011-12-01 Thread Sasha Levin
On Thu, 2011-12-01 at 10:48 +0200, Pekka Enberg wrote: On Wed, 30 Nov 2011, Asias He wrote: In virtio net's notify_vq(), we simply signal the tx/rx handle thread and return. Why not use the threadpool? No. Sasha? I was looking into the concept of adding 'dedicated' threads to the

Re: [PATCH] kvm tools: Process virito blk requests in separate thread

2011-12-01 Thread Pekka Enberg
On Thu, Dec 1, 2011 at 10:58 AM, Sasha Levin levinsasha...@gmail.com wrote: I was looking into the concept of adding 'dedicated' threads to the threadpool, since when the threadpool was added originally one of the purposes was to have all worker threads in a single place. This way we could

[PATCH] kvm tools: Process virito blk requests in separate thread

2011-11-29 Thread Asias He
Currently, all blk requests are processed in notify_vq() which is in the context of ioeventfd thread: ioeventfd__thread(). The processing in notify_vq() may take a long time to complete. We should make notify_vq() return as soon as possible, since all devices are sharing the single ioeventfd

Re: [PATCH] kvm tools: Process virito blk requests in separate thread

2011-11-29 Thread Sasha Levin
On Tue, 2011-11-29 at 22:28 +0800, Asias He wrote: Currently, all blk requests are processed in notify_vq() which is in the context of ioeventfd thread: ioeventfd__thread(). The processing in notify_vq() may take a long time to complete. We should make notify_vq() return as soon as possible,

Re: [PATCH] kvm tools: Process virito blk requests in separate thread

2011-11-29 Thread Asias He
On 11/29/2011 10:36 PM, Sasha Levin wrote: On Tue, 2011-11-29 at 22:28 +0800, Asias He wrote: Currently, all blk requests are processed in notify_vq() which is in the context of ioeventfd thread: ioeventfd__thread(). The processing in notify_vq() may take a long time to complete. We should