qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH for-3.0] file-posix: Fix write_zeroes with unmap


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH for-3.0] file-posix: Fix write_zeroes with unmap on block devices
Date: Thu, 26 Jul 2018 11:10:19 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

On 07/26/2018 10:33 AM, Kevin Wolf wrote:


As far as I know, the comment you quoted is accurate for BLKDISCARD and
BLKZEROOUT, but not for the fallocate() flags.


I sure wish the man pages were more explicit on what guarantees each flag offers.

Hmm - that thread also mentions FALLOC_FL_NO_HIDE_STALE, which is a new flag
not present/documented on Fedora 28. I wonder if it helps, too.


FALLOC_FL_ZERO_RANGE in contrast implements write_zeroes without unmap.

I thought the opposite: FALLOC_FL_ZERO_RANGE guarantees that you read back
0, using whatever is most efficient under the hood (in the case of block
devices, unmapping that reliably reads back as zero is favored).

See the code I quoted above, FALLOC_FL_ZERO_RANGE calls
blkdev_issue_zeroout() with BLKDEV_ZERO_NOUNMAP internally.

Having to resort to reading the kernel code to learn what the guarantees are is annoying (it's nice that GPL guarantees that we CAN do that, but it means the man pages could use some TLC so that we don't have to). Especially since the kernel code has changed over time.

But your paste of current kernel code is rather hard to argue against.

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org



reply via email to

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