Re: [PATCH v3] virtio_blk: unlock vblk-lock during kick

2012-06-08 Thread Michael S. Tsirkin
On Wed, Jun 06, 2012 at 04:25:55PM +0100, Stefan Hajnoczi wrote: On Mon, Jun 4, 2012 at 12:11 PM, Michael S. Tsirkin m...@redhat.com wrote: On Fri, Jun 01, 2012 at 10:13:06AM +0100, Stefan Hajnoczi wrote: diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index

Re: [PATCH v3] virtio_blk: unlock vblk-lock during kick

2012-06-06 Thread Stefan Hajnoczi
On Mon, Jun 4, 2012 at 12:15 PM, Michael S. Tsirkin m...@redhat.com wrote: On Fri, Jun 01, 2012 at 10:13:06AM +0100, Stefan Hajnoczi wrote: Other block drivers (cciss, rbd, nbd) use spin_unlock_irq() so I followed that. To me this seems wrong: blk_run_queue() uses spin_lock_irqsave() but we

Re: [PATCH v3] virtio_blk: unlock vblk-lock during kick

2012-06-06 Thread Stefan Hajnoczi
On Mon, Jun 4, 2012 at 12:11 PM, Michael S. Tsirkin m...@redhat.com wrote: On Fri, Jun 01, 2012 at 10:13:06AM +0100, Stefan Hajnoczi wrote: diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 774c31d..d674977 100644 --- a/drivers/block/virtio_blk.c +++

Re: [PATCH v3] virtio_blk: unlock vblk-lock during kick

2012-06-04 Thread Asias He
On 06/01/2012 05:13 PM, Stefan Hajnoczi wrote: Holding the vblk-lock across kick causes poor scalability in SMP guests. If one CPU is doing virtqueue kick and another CPU touches the vblk-lock it will have to spin until virtqueue kick completes. This patch reduces system% CPU utilization in

Re: [PATCH v3] virtio_blk: unlock vblk-lock during kick

2012-06-04 Thread Michael S. Tsirkin
On Fri, Jun 01, 2012 at 10:13:06AM +0100, Stefan Hajnoczi wrote: Holding the vblk-lock across kick causes poor scalability in SMP guests. If one CPU is doing virtqueue kick and another CPU touches the vblk-lock it will have to spin until virtqueue kick completes. This patch reduces system%

Re: [PATCH v3] virtio_blk: unlock vblk-lock during kick

2012-06-04 Thread Michael S. Tsirkin
On Fri, Jun 01, 2012 at 10:13:06AM +0100, Stefan Hajnoczi wrote: Other block drivers (cciss, rbd, nbd) use spin_unlock_irq() so I followed that. To me this seems wrong: blk_run_queue() uses spin_lock_irqsave() but we enable irqs with spin_unlock_irq(). If the caller of blk_run_queue() had

[PATCH v3] virtio_blk: unlock vblk-lock during kick

2012-06-01 Thread Stefan Hajnoczi
Holding the vblk-lock across kick causes poor scalability in SMP guests. If one CPU is doing virtqueue kick and another CPU touches the vblk-lock it will have to spin until virtqueue kick completes. This patch reduces system% CPU utilization in SMP guests that are running multithreaded I/O-bound