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 WRITESAME. It

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 saved bandwidth

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. this

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

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

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 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_write_zeroes

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

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 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, which

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 bit

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 (allocating even

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). Which

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

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 to know what

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 lot of potential

[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

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