Re: [Qemu-devel] [RFC PATCH 06/17] block: use bdrv_{co, aio}_discard for write_zeroes operations

2012-03-26 Thread Richard Laager
On Sat, 2012-03-24 at 16:30 +0100, Christoph Hellwig wrote: > On Wed, Mar 14, 2012 at 01:14:18PM +0100, Paolo Bonzini wrote: > > > > Note that the discard granularity is only a hint, so it's really more a > > maximum suggested value than a granularity. Outside of a cluster > > boundary the format

Re: [Qemu-devel] [RFC PATCH 06/17] block: use bdrv_{co, aio}_discard for write_zeroes operations

2012-03-26 Thread Richard Laager
On Sat, 2012-03-24 at 16:27 +0100, Christoph Hellwig wrote: > > has_discard = !fallocate(s->fd, FALLOC_FL_PUNCH_HOLE | > > FALLOC_FL_KEEP_SIZE, > > There is no point in using FALLOC_FL_KEEP_SIZE together with > FALLOC_FL_PUNCH_HOLE. It's *required*. From the man page [0], "The FALLOC_FL_

Re: [Qemu-devel] [RFC PATCH 06/17] block: use bdrv_{co, aio}_discard for write_zeroes operations

2012-03-15 Thread Richard Laager
On Thu, 2012-03-15 at 10:36 +0100, Paolo Bonzini wrote: > Changing across guest boots is a minor problem, but changing across > migration must be avoided at all costs. > > BTW, after this discussion I think we can instead report > discard_granularity = 512 and discard_zeroes_data=0 and get most of

Re: [Qemu-devel] [RFC PATCH 06/17] block: use bdrv_{co, aio}_discard for write_zeroes operations

2012-03-14 Thread Richard Laager
On Wed, 2012-03-14 at 08:41 +0100, Paolo Bonzini wrote: > Il 13/03/2012 20:13, Richard Laager ha scritto: > >>> > > * For SCSI, report an unmap_granularity to the guest as follows: > >>> > > max(logical_block_size, discard_granu

Re: [Qemu-devel] [RFC PATCH 06/17] block: use bdrv_{co, aio}_discard for write_zeroes operations

2012-03-13 Thread Richard Laager
U. On Mon, 2012-03-12 at 13:27 +0100, Paolo Bonzini wrote: > Il 10/03/2012 19:02, Richard Laager ha scritto: > > I propose adding the following behaviors in any event: > > * If a QEMU block device reports a discard_granularity > 0, it > > must be equ

Re: [Qemu-devel] [RFC PATCH 06/17] block: use bdrv_{co, aio}_discard for write_zeroes operations

2012-03-10 Thread Richard Laager
I'm believe your patch set provides these behaviors now: * QEMU block drivers report discard_granularity. * discard_granularity = 0 means no discard * The guest is told there's no discard support. * discard_granularity < 0 is undefined.

Re: [Qemu-devel] [RFC PATCH 14/17] block: support FALLOC_FL_PUNCH_HOLE trimming

2012-03-09 Thread Richard Laager
I was just working on this as well, though your implementation is *far* more complete than mine. (I was only looking at making changes to the discard implementation in block/raw-posix.c.) I've got several comments, which I've separated by logical topic... BLKDISCARD fallocate(