Re: [Qemu-block] [PATCH] nvme: Implement Write Zeroes

2017-05-05 Thread Christoph Hellwig
On Fri, May 05, 2017 at 12:03:40PM +0200, Paolo Bonzini wrote: > While that's allowed and it makes sense indeed on SSDs, for QEMU's > typical usage it can lead to fragmentation and worse performance. On > extent-based file systems, write zeroes without deallocate can be > implemented very efficien

Re: [Qemu-block] [PATCH] nvme: Implement Write Zeroes

2017-05-05 Thread Paolo Bonzini
On 05/05/2017 11:51, Christoph Hellwig wrote: >> could you pass BDRV_REQ_MAY_UNMAP for the flags here if the deallocate >> bit (dword 12 bit 25) is set? > In fact we should do that unconditonally. The deallocate bit is new > in 1.3 (which we don't claim to support) and forces deallocating, but >

Re: [Qemu-block] [PATCH] nvme: Implement Write Zeroes

2017-05-05 Thread Christoph Hellwig
On Fri, May 05, 2017 at 11:30:11AM +0200, Paolo Bonzini wrote: > could you pass BDRV_REQ_MAY_UNMAP for the flags here if the deallocate > bit (dword 12 bit 25) is set? In fact we should do that unconditonally. The deallocate bit is new in 1.3 (which we don't claim to support) and forces deallocat

Re: [Qemu-block] [PATCH] nvme: Implement Write Zeroes

2017-05-05 Thread Paolo Bonzini
On 05/05/2017 11:00, Christoph Hellwig wrote: > Signed-off-by: Keith Busch > [hch: ported over from qemu-nvme.git to mainline] > Signed-off-by: Christoph Hellwig > --- > hw/block/nvme.c | 26 ++ > hw/block/nvme.h | 1 + > 2 files changed, 27 insertions(+) > > diff --g

[Qemu-block] [PATCH] nvme: Implement Write Zeroes

2017-05-05 Thread Christoph Hellwig
Signed-off-by: Keith Busch [hch: ported over from qemu-nvme.git to mainline] Signed-off-by: Christoph Hellwig --- hw/block/nvme.c | 26 ++ hw/block/nvme.h | 1 + 2 files changed, 27 insertions(+) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index ae303d44e5..3f4d2bf2b