|
From: | Denis V. Lunev |
Subject: | Re: [Qemu-devel] [RFC 1/1] nbd (specification): add NBD_CMD_WRITE_ZEROES command |
Date: | Thu, 18 Feb 2016 11:34:04 +0300 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 |
On 02/18/2016 11:09 AM, Alex Bligh wrote:
On 17 Feb 2016, at 18:10, Denis V. Lunev <address@hidden> wrote:Currently available NBD_CMD_TRIM command can not be used as the specification explicitely says that "a client MUST NOT make any assumptions about the contents of the export affected by this [NBD_CMD_TRIM] command, until overwriting it again with `NBD_CMD_WRITE`"Would a flag to NBD_CMD_TRIM that says "ensure the written data is zeroed" not be an easier solution than adding another very similar command? Or (cough) changing the spec?
from the point of the receiver the situation (from my POW) could be different. Let us assume that we are writing to the plain file. There are 2 type of queries: - pls make the target sparse, i.e. perform FALLOC_FL_PUNCH_HOLE and there is no problem that the operation could not be performed, this is a hint; - pls write the following amount of zeroes in either way (even calling write directly), i.e. ensure that the data is zeroed and the space on the file system is allocated for that. The difference comes from the situation when sparse files results in a serious performance impact if written by small pieces. In this case the data of one block of the virtual disk can be placed to very different blocks of the physical disk seriously impacting subsequent sequential reading. Thus I propose to make the situation distinct for these commands. Though you proposal to add NBD_FLAG_SEND_TRIM_ZEROED to export flags is also great. Though this IMHO is a different story. Den
[Prev in Thread] | Current Thread | [Next in Thread] |