qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 1/1] NBD proto: add WRITE_ZEROES extension


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v2 1/1] NBD proto: add WRITE_ZEROES extension
Date: Thu, 31 Mar 2016 15:55:54 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0


On 31/03/2016 15:53, Alex Bligh wrote:
>> > +    If the flag `NBD_CMD_FLAG_MAY_TRIM` was set by the client in the 
>> > command
>> > +    flags field, the server MAY use trimming to zero out the area, but it
>> > +    MUST ensure that the data reads back as zero.
>> > +
> Can you give an example of a situation where the client would not set this
> and it would be undesirable for the server to create a 'hole' using
> 'trim' type technology, even when the client doesn't specify it?
> I suspect there are already some backends (e.g. ceph on qemu-nbd) which
> will effectively do a 'trim' if you write 4k of zeroes even under
> current circumstances.
> 
> IE why not always permit trimming PROVIDED the data always reads back
> as zero? This would be far simpler.

Because trimming can make future operations more expensive and cause
fragmentation (which may not be as bad as it used to be at the media
level, but it is still somewhat bad at the filesystem level).

So if you want a fully-provisioned file, the simplest way to do so is to
write zeroes to it, and trimming is undesirable.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]