Re: [Qemu-devel] [RFC PATCH] block: optimize zero writes with bdrv_write_zeroes

2014-02-25 Thread Peter Lieven
Am 25.02.2014 14:41, schrieb Kevin Wolf: > Am 24.02.2014 um 14:01 hat Peter Lieven geschrieben: >> On 24.02.2014 11:38, Paolo Bonzini wrote: >>> Il 24/02/2014 11:26, Peter Lieven ha scritto: I personally do not need this for QCOW2 but for iSCSI. Here the optimization is basically sa

Re: [Qemu-devel] [RFC PATCH] block: optimize zero writes with bdrv_write_zeroes

2014-02-25 Thread Kevin Wolf
Am 24.02.2014 um 14:01 hat Peter Lieven geschrieben: > On 24.02.2014 11:38, Paolo Bonzini wrote: > >Il 24/02/2014 11:26, Peter Lieven ha scritto: > >> > >>I personally do not need this for QCOW2 but for iSCSI. Here the optimization > >>is basically saved bandwidth since a zero write becomes a WRITE

Re: [Qemu-devel] [RFC PATCH] block: optimize zero writes with bdrv_write_zeroes

2014-02-24 Thread Peter Lieven
On 24.02.2014 11:38, Paolo Bonzini wrote: Il 24/02/2014 11:26, Peter Lieven ha scritto: I personally do not need this for QCOW2 but for iSCSI. Here the optimization is basically saved bandwidth since a zero write becomes a WRITESAME. It saves bandwidth, but at the potential cost of extra host

Re: [Qemu-devel] [RFC PATCH] block: optimize zero writes with bdrv_write_zeroes

2014-02-24 Thread Paolo Bonzini
Il 24/02/2014 13:07, Kevin Wolf ha scritto: > Yeah, that's why I wrote "or should be". Those are the intended > semantics of bdrv_co_write_zeroes without BDRV_REQ_MAY_UNMAP: always > allocate a cluster that will read as zeroes (allocating even if it > does not necessarily write the zeroes). Whi

Re: [Qemu-devel] [RFC PATCH] block: optimize zero writes with bdrv_write_zeroes

2014-02-24 Thread Kevin Wolf
Am 24.02.2014 um 13:10 hat Paolo Bonzini geschrieben: > Il 24/02/2014 13:07, Kevin Wolf ha scritto: > >>> Yeah, that's why I wrote "or should be". Those are the intended > >>> semantics of bdrv_co_write_zeroes without BDRV_REQ_MAY_UNMAP: always > >>> allocate a cluster that will read as zeroes (al

Re: [Qemu-devel] [RFC PATCH] block: optimize zero writes with bdrv_write_zeroes

2014-02-24 Thread Fam Zheng
On Mon, 02/24 12:51, Paolo Bonzini wrote: > Il 24/02/2014 12:33, Fam Zheng ha scritto: > >> This is (or should be) bdrv_co_write_zeroes without BDRV_REQ_MAY_UNMAP. > > > >But IIUC bdrv_co_write_zeroes without BDRV_REQ_MAY_UNMAP doesn't require > >cluster allocation if it's allocated yet, which is a

Re: [Qemu-devel] [RFC PATCH] block: optimize zero writes with bdrv_write_zeroes

2014-02-24 Thread Kevin Wolf
Am 24.02.2014 um 12:51 hat Paolo Bonzini geschrieben: > Il 24/02/2014 12:33, Fam Zheng ha scritto: > >> This is (or should be) bdrv_co_write_zeroes without BDRV_REQ_MAY_UNMAP. > > > >But IIUC bdrv_co_write_zeroes without BDRV_REQ_MAY_UNMAP doesn't require > >cluster allocation if it's allocated yet

Re: [Qemu-devel] [RFC PATCH] block: optimize zero writes with bdrv_write_zeroes

2014-02-24 Thread Paolo Bonzini
Il 24/02/2014 12:33, Fam Zheng ha scritto: > This is (or should be) bdrv_co_write_zeroes without BDRV_REQ_MAY_UNMAP. But IIUC bdrv_co_write_zeroes without BDRV_REQ_MAY_UNMAP doesn't require cluster allocation if it's allocated yet, which is a bit different. Yeah, that's why I wrote "or should

Re: [Qemu-devel] [RFC PATCH] block: optimize zero writes with bdrv_write_zeroes

2014-02-24 Thread Peter Lieven
On 24.02.2014 11:38, Paolo Bonzini wrote: Il 24/02/2014 11:26, Peter Lieven ha scritto: I personally do not need this for QCOW2 but for iSCSI. Here the optimization is basically saved bandwidth since a zero write becomes a WRITESAME. It saves bandwidth, but at the potential cost of extra host

Re: [Qemu-devel] [RFC PATCH] block: optimize zero writes with bdrv_write_zeroes

2014-02-24 Thread Fam Zheng
On Mon, 02/24 11:39, Paolo Bonzini wrote: > Il 24/02/2014 02:01, Fam Zheng ha scritto: > > > >I would do this in qcow2: > > > > 1. In qcow2_co_writev, allocate cluster regardless of if data is zero or > > not. > > 2. If data is zero, set QCOW2_OFLAG_ZERO in L2. > > This is (or should be) bdrv_co_

Re: [Qemu-devel] [RFC PATCH] block: optimize zero writes with bdrv_write_zeroes

2014-02-24 Thread Paolo Bonzini
Il 24/02/2014 02:01, Fam Zheng ha scritto: I would do this in qcow2: 1. In qcow2_co_writev, allocate cluster regardless of if data is zero or not. 2. If data is zero, set QCOW2_OFLAG_ZERO in L2. This is (or should be) bdrv_co_write_zeroes without BDRV_REQ_MAY_UNMAP. Paolo

Re: [Qemu-devel] [RFC PATCH] block: optimize zero writes with bdrv_write_zeroes

2014-02-24 Thread Paolo Bonzini
Il 24/02/2014 11:26, Peter Lieven ha scritto: I personally do not need this for QCOW2 but for iSCSI. Here the optimization is basically saved bandwidth since a zero write becomes a WRITESAME. It saves bandwidth, but at the potential cost of extra host CPU utilization. I would be fine with ha

Re: [Qemu-devel] [RFC PATCH] block: optimize zero writes with bdrv_write_zeroes

2014-02-24 Thread Peter Lieven
On 24.02.2014 11:11, Kevin Wolf wrote: Am 22.02.2014 um 14:00 hat Peter Lieven geschrieben: this patch tries to optimize zero write requests by automatically using bdrv_write_zeroes if it is supported by the format. i know that there is a lot of potential for discussion, but i would like to kno

Re: [Qemu-devel] [RFC PATCH] block: optimize zero writes with bdrv_write_zeroes

2014-02-24 Thread Kevin Wolf
Am 22.02.2014 um 14:00 hat Peter Lieven geschrieben: > this patch tries to optimize zero write requests > by automatically using bdrv_write_zeroes if it is > supported by the format. > > i know that there is a lot of potential for discussion, but i would > like to know what the others think. > >

Re: [Qemu-devel] [RFC PATCH] block: optimize zero writes with bdrv_write_zeroes

2014-02-23 Thread Fam Zheng
On Sun, 02/23 20:10, Peter Lieven wrote: > Am 22.02.2014 17:45, schrieb Fam Zheng: > > On Sat, 02/22 14:00, Peter Lieven wrote: > >> this patch tries to optimize zero write requests > >> by automatically using bdrv_write_zeroes if it is > >> supported by the format. > >> > >> i know that there is a

Re: [Qemu-devel] [RFC PATCH] block: optimize zero writes with bdrv_write_zeroes

2014-02-23 Thread Peter Lieven
Am 22.02.2014 17:45, schrieb Fam Zheng: > On Sat, 02/22 14:00, Peter Lieven wrote: >> this patch tries to optimize zero write requests >> by automatically using bdrv_write_zeroes if it is >> supported by the format. >> >> i know that there is a lot of potential for discussion, but i would >> like t

Re: [Qemu-devel] [RFC PATCH] block: optimize zero writes with bdrv_write_zeroes

2014-02-22 Thread Fam Zheng
On Sat, 02/22 14:00, Peter Lieven wrote: > this patch tries to optimize zero write requests > by automatically using bdrv_write_zeroes if it is > supported by the format. > > i know that there is a lot of potential for discussion, but i would > like to know what the others think. > > this should

[Qemu-devel] [RFC PATCH] block: optimize zero writes with bdrv_write_zeroes

2014-02-22 Thread Peter Lieven
this patch tries to optimize zero write requests by automatically using bdrv_write_zeroes if it is supported by the format. i know that there is a lot of potential for discussion, but i would like to know what the others think. this should significantly speed up file system initialization and sho