[PATCH 1/3] block: Introduce __blk_segment_map_sg() helper

2012-06-18 Thread Asias He
Split the mapping code in blk_rq_map_sg() to a helper __blk_segment_map_sg(), so that other mapping function, e.g. blk_bio_map_sg(), can share the code. Cc: Jens Axboe ax...@kernel.dk Cc: Tejun Heo t...@kernel.org Cc: Shaohua Li s...@kernel.org Cc: linux-ker...@vger.kernel.org Suggested-by: Tejun

[PATCH v2 2/3] block: Add blk_bio_map_sg() helper

2012-06-18 Thread Asias He
Add a helper to map a bio to a scatterlist, modelled after blk_rq_map_sg. This helper is useful for any driver that wants to create a scatterlist from its -make_request_fn method. Changes in v2: - Use __blk_segment_map_sg to avoid duplicated code - Add cocbook style function comment Cc: Jens

[PATCH 3/3] virtio-blk: Add bio-based IO path for virtio-blk

2012-06-18 Thread Asias He
This patch introduces bio-based IO path for virtio-blk. Compared to request-based IO path, bio-based IO path uses driver provided -make_request_fn() method to bypasses the IO scheduler. It handles the bio to device directly without allocating a request in block layer. This reduces the IO path in

Re: [PATCH 3/3] virtio-blk: Add bio-based IO path for virtio-blk

2012-06-18 Thread Rusty Russell
On Mon, 18 Jun 2012 14:53:10 +0800, Asias He as...@redhat.com wrote: This patch introduces bio-based IO path for virtio-blk. Why make it optional? Thanks, Rusty. ___ Virtualization mailing list Virtualization@lists.linux-foundation.org

Re: [PATCH v2 0/3] Improve virtio-blk performance

2012-06-18 Thread Stefan Hajnoczi
On Mon, Jun 18, 2012 at 7:53 AM, Asias He as...@redhat.com wrote: Fio test shows it gives, 28%, 24%, 21%, 16% IOPS boost and 32%, 17%, 21%, 16% latency improvement for sequential read/write, random read/write respectively. Sounds great. What storage configuration did you use (single spinning

Re: [PATCH 3/3] virtio-blk: Add bio-based IO path for virtio-blk

2012-06-18 Thread Stefan Hajnoczi
On Mon, Jun 18, 2012 at 7:53 AM, Asias He as...@redhat.com wrote: +static void virtblk_add_buf_wait(struct virtio_blk *vblk, +                                struct virtblk_req *vbr, +                                unsigned long out, +                                unsigned long in) +{ +  

Re: [PATCH v2 0/3] Improve virtio-blk performance

2012-06-18 Thread Asias He
On 06/18/2012 05:14 PM, Stefan Hajnoczi wrote: On Mon, Jun 18, 2012 at 7:53 AM, Asias He as...@redhat.com wrote: Fio test shows it gives, 28%, 24%, 21%, 16% IOPS boost and 32%, 17%, 21%, 16% latency improvement for sequential read/write, random read/write respectively. Sounds great. What

Re: [PATCH 3/3] virtio-blk: Add bio-based IO path for virtio-blk

2012-06-18 Thread Michael S. Tsirkin
On Mon, Jun 18, 2012 at 04:03:23PM +0800, Asias He wrote: On 06/18/2012 03:46 PM, Rusty Russell wrote: On Mon, 18 Jun 2012 14:53:10 +0800, Asias He as...@redhat.com wrote: This patch introduces bio-based IO path for virtio-blk. Why make it optional? request-based IO path is useful for

Re: [PATCH 3/3] virtio-blk: Add bio-based IO path for virtio-blk

2012-06-18 Thread Michael S. Tsirkin
On Mon, Jun 18, 2012 at 02:53:10PM +0800, Asias He wrote: +static void virtblk_make_request(struct request_queue *q, struct bio *bio) +{ + struct virtio_blk *vblk = q-queuedata; + unsigned int num, out = 0, in = 0; + struct virtblk_req *vbr; + + BUG_ON(bio-bi_phys_segments +

Re: [PATCH 3/3] virtio-blk: Add bio-based IO path for virtio-blk

2012-06-18 Thread Stefan Hajnoczi
On Mon, Jun 18, 2012 at 11:21 AM, Michael S. Tsirkin m...@redhat.com wrote: On Mon, Jun 18, 2012 at 02:53:10PM +0800, Asias He wrote: +static void virtblk_make_request(struct request_queue *q, struct bio *bio) +{ +     struct virtio_blk *vblk = q-queuedata; +     unsigned int num, out = 0, in

Re: [PATCH v2 0/3] Improve virtio-blk performance

2012-06-18 Thread Stefan Hajnoczi
On Mon, Jun 18, 2012 at 10:39 AM, Asias He as...@redhat.com wrote: On 06/18/2012 05:14 PM, Stefan Hajnoczi wrote: On Mon, Jun 18, 2012 at 7:53 AM, Asias He as...@redhat.com wrote: Fio test shows it gives, 28%, 24%, 21%, 16% IOPS boost and 32%, 17%, 21%, 16% latency improvement for

Re: [PATCH 3/3] virtio-blk: Add bio-based IO path for virtio-blk

2012-06-18 Thread Dor Laor
On 06/18/2012 01:05 PM, Rusty Russell wrote: On Mon, 18 Jun 2012 16:03:23 +0800, Asias Heas...@redhat.com wrote: On 06/18/2012 03:46 PM, Rusty Russell wrote: On Mon, 18 Jun 2012 14:53:10 +0800, Asias Heas...@redhat.com wrote: This patch introduces bio-based IO path for virtio-blk. Why

Re: [PATCH 3/3] virtio-blk: Add bio-based IO path for virtio-blk

2012-06-18 Thread Sasha Levin
On Mon, 2012-06-18 at 14:14 +0300, Dor Laor wrote: On 06/18/2012 01:05 PM, Rusty Russell wrote: On Mon, 18 Jun 2012 16:03:23 +0800, Asias Heas...@redhat.com wrote: On 06/18/2012 03:46 PM, Rusty Russell wrote: On Mon, 18 Jun 2012 14:53:10 +0800, Asias Heas...@redhat.com wrote: This patch

Re: [PATCH RFC] virtio-spec: flexible configuration layout

2012-06-18 Thread Michael S. Tsirkin
On Wed, Nov 09, 2011 at 02:36:43PM +0200, Pekka Enberg wrote: On Wed, 9 Nov 2011, Sasha Levin wrote: They don't exist in kernel code either, for same reason as above. Nothing will break if we remove it since no one really used it, we were probably the first and only implementation of the

Re: [Qemu-devel] [PATCH RFC] virtio-pci: add MMIO property

2012-06-18 Thread Michael S. Tsirkin
On Tue, Mar 20, 2012 at 10:22:42AM +1030, Rusty Russell wrote: On Mon, 19 Mar 2012 17:13:06 -0500, Anthony Liguori anth...@codemonkey.ws wrote: Maybe just make this a hidden option like x-miio? x-violate-the-virtio-spec-to-trick-old-linux-drivers-into-working-on-power? To configure

Re: [PATCH RFC] virtio-spec: flexible configuration layout

2012-06-18 Thread Michael S. Tsirkin
On Mon, Jun 18, 2012 at 02:05:17PM +0200, Sasha Levin wrote: On Mon, 2012-06-18 at 14:54 +0300, Michael S. Tsirkin wrote: On Wed, Nov 09, 2011 at 02:36:43PM +0200, Pekka Enberg wrote: On Wed, 9 Nov 2011, Sasha Levin wrote: They don't exist in kernel code either, for same reason as above.

[RFC 2/2] virtio-ring: Allocate indirect buffers from cache when possible

2012-06-18 Thread Sasha Levin
Currently if VIRTIO_RING_F_INDIRECT_DESC is enabled we will use indirect descriptors and allocate them using a simple kmalloc(). This patch adds a cache which will allow indirect buffers under a configurable size to be allocated from that cache instead. Signed-off-by: Sasha Levin

[RFC 1/2] virtio-ring: Use threshold for switching to indirect descriptors

2012-06-18 Thread Sasha Levin
Currently if VIRTIO_RING_F_INDIRECT_DESC is enabled we will use indirect descriptors even if we have plenty of space in the ring. This means that we take a performance hit at all times due to the overhead of creating indirect descriptors. Instead, use it only after we're below a configurable

Re: [PATCH 3/3] virtio-blk: Add bio-based IO path for virtio-blk

2012-06-18 Thread Tejun Heo
Hello, guys. On Mon, Jun 18, 2012 at 07:35:22PM +0930, Rusty Russell wrote: On Mon, 18 Jun 2012 16:03:23 +0800, Asias He as...@redhat.com wrote: On 06/18/2012 03:46 PM, Rusty Russell wrote: On Mon, 18 Jun 2012 14:53:10 +0800, Asias He as...@redhat.com wrote: This patch introduces

Re: [PATCH 1/3] block: Introduce __blk_segment_map_sg() helper

2012-06-18 Thread Tejun Heo
Hello, Asias. On Mon, Jun 18, 2012 at 02:53:08PM +0800, Asias He wrote: Split the mapping code in blk_rq_map_sg() to a helper __blk_segment_map_sg(), so that other mapping function, e.g. blk_bio_map_sg(), can share the code. Cc: Jens Axboe ax...@kernel.dk Cc: Tejun Heo t...@kernel.org Cc:

Re: [PATCH 1/3] block: Introduce __blk_segment_map_sg() helper

2012-06-18 Thread Asias He
On 06/19/2012 05:31 AM, Tejun Heo wrote: Hello, Asias. On Mon, Jun 18, 2012 at 02:53:08PM +0800, Asias He wrote: Split the mapping code in blk_rq_map_sg() to a helper __blk_segment_map_sg(), so that other mapping function, e.g. blk_bio_map_sg(), can share the code. Cc: Jens Axboe

Re: [PATCH 3/3] virtio-blk: Add bio-based IO path for virtio-blk

2012-06-18 Thread Asias He
On 06/18/2012 06:13 PM, Michael S. Tsirkin wrote: On Mon, Jun 18, 2012 at 04:03:23PM +0800, Asias He wrote: On 06/18/2012 03:46 PM, Rusty Russell wrote: On Mon, 18 Jun 2012 14:53:10 +0800, Asias He as...@redhat.com wrote: This patch introduces bio-based IO path for virtio-blk. Why make it

Re: [PATCH 3/3] virtio-blk: Add bio-based IO path for virtio-blk

2012-06-18 Thread Asias He
On 06/18/2012 06:21 PM, Michael S. Tsirkin wrote: On Mon, Jun 18, 2012 at 02:53:10PM +0800, Asias He wrote: +static void virtblk_make_request(struct request_queue *q, struct bio *bio) +{ + struct virtio_blk *vblk = q-queuedata; + unsigned int num, out = 0, in = 0; + struct

Re: [PATCH 3/3] virtio-blk: Add bio-based IO path for virtio-blk

2012-06-18 Thread Asias He
On 06/18/2012 06:05 PM, Rusty Russell wrote: On Mon, 18 Jun 2012 16:03:23 +0800, Asias He as...@redhat.com wrote: On 06/18/2012 03:46 PM, Rusty Russell wrote: On Mon, 18 Jun 2012 14:53:10 +0800, Asias He as...@redhat.com wrote: This patch introduces bio-based IO path for virtio-blk. Why

Re: [PATCH v2 0/3] Improve virtio-blk performance

2012-06-18 Thread Asias He
On 06/18/2012 06:58 PM, Stefan Hajnoczi wrote: As long as the latency is decreasing that's good. But It's worth keeping in mind that these percentages are probably wildly different on real storage devices and/or qemu-kvm. What we don't know here is whether this bottleneck matters in real