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

2012-07-31 Thread Asias He
On 07/30/2012 09:43 PM, Christoph Hellwig wrote: On Mon, Jul 30, 2012 at 12:43:12PM +0800, Asias He wrote: I think we can add REQ_FLUSH REQ_FUA support to bio path and that deserves another patch. Adding it is a requirement for merging the code. OK. Will add that. -- Asias

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

2012-07-30 Thread Paolo Bonzini
Il 30/07/2012 06:43, Asias He ha scritto: Yes. Something like this: qemu -drive file=foo.img,cache=writeback/unsafe is not safe against power losses also? cache=writeback and cache=none are safe, cache=unsafe isn't. I think we can add REQ_FLUSH REQ_FUA support to bio path and that

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

2012-07-30 Thread Christoph Hellwig
On Mon, Jul 30, 2012 at 09:31:06AM +0200, Paolo Bonzini wrote: You only need to add REQ_FLUSH support. The virtio-blk protocol does not support REQ_FUA, because there's no easy way to do it in userspace. A bio-based driver needs to handle both REQ_FLUSH and REQ_FUA as it does not get the

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

2012-07-30 Thread Christoph Hellwig
On Mon, Jul 30, 2012 at 12:43:12PM +0800, Asias He wrote: I think we can add REQ_FLUSH REQ_FUA support to bio path and that deserves another patch. Adding it is a requirement for merging the code. ___ Virtualization mailing list

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

2012-07-29 Thread Michael S. Tsirkin
On Sat, Jul 28, 2012 at 10:38:41AM +0800, Asias He wrote: On 07/27/2012 08:33 AM, Rusty Russell wrote: On Fri, 13 Jul 2012 16:38:51 +0800, Asias He as...@redhat.com wrote: Add 'virtio_blk.use_bio=1' to kernel cmdline or 'modprobe virtio_blk use_bio=1' to enable -make_request_fn() based I/O

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

2012-07-29 Thread Asias He
On 07/29/2012 08:59 PM, Michael S. Tsirkin wrote: On Sat, Jul 28, 2012 at 10:38:41AM +0800, Asias He wrote: On 07/27/2012 08:33 AM, Rusty Russell wrote: On Fri, 13 Jul 2012 16:38:51 +0800, Asias He as...@redhat.com wrote: Add 'virtio_blk.use_bio=1' to kernel cmdline or 'modprobe virtio_blk

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

2012-07-29 Thread Asias He
On 07/28/2012 02:42 PM, Paolo Bonzini wrote: I'm not sure what the correct behavior for bio cacheflush is, if any. REQ_FLUSH is not supported in the bio path. Ouch, that's correct: @@ -414,7 +529,7 @@ static void virtblk_update_cache_mode(struct virtio_device *vdev) u8 writeback =

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

2012-07-28 Thread Paolo Bonzini
I'm not sure what the correct behavior for bio cacheflush is, if any. REQ_FLUSH is not supported in the bio path. Ouch, that's correct: @@ -414,7 +529,7 @@ static void virtblk_update_cache_mode(struct virtio_device *vdev) u8 writeback = virtblk_get_cache_mode(vdev);

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

2012-07-27 Thread Rusty Russell
On Fri, 13 Jul 2012 16:38:51 +0800, Asias He as...@redhat.com wrote: This patch introduces bio-based IO path for virtio-blk. Acked-by: Rusty Russell ru...@rustcorp.com.au I just hope we can do better than a module option in future. Thanks, Rusty. ___

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

2012-07-27 Thread Asias He
On 07/27/2012 08:33 AM, Rusty Russell wrote: On Fri, 13 Jul 2012 16:38:51 +0800, Asias He as...@redhat.com wrote: Add 'virtio_blk.use_bio=1' to kernel cmdline or 'modprobe virtio_blk use_bio=1' to enable -make_request_fn() based I/O path. This patch conflicts with Paolo's Bonzini's

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

2012-07-26 Thread Rusty Russell
On Fri, 13 Jul 2012 16:38:51 +0800, Asias He as...@redhat.com wrote: Add 'virtio_blk.use_bio=1' to kernel cmdline or 'modprobe virtio_blk use_bio=1' to enable -make_request_fn() based I/O path. This patch conflicts with Paolo's Bonzini's 'virtio-blk: allow toggling host cache between writeback

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

2012-07-13 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