[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH] qcow2: Support BDRV_REQ_MAY_UNMAP
From: |
Max Reitz |
Subject: |
Re: [Qemu-block] [PATCH] qcow2: Support BDRV_REQ_MAY_UNMAP |
Date: |
Sat, 1 Oct 2016 15:08:51 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 |
On 29.09.2016 10:10, Fam Zheng wrote:
> On Thu, 09/29 09:58, Paolo Bonzini wrote:
>>
>>
>> On 29/09/2016 04:21, Fam Zheng wrote:
>>> On Wed, 09/28 18:11, Max Reitz wrote:
>>>> Note that BDRV_REQ_MAY_UNMAP does not mean "Yes, please discard" but
>>>> just "You may discard if it's easier for you". But it's actually not
>>>> easier for us, so I don't see why we're doing it.
>>>>
>>>> As far as I can guess you actually want some way to tell a block driver
>>>> to actually make an effort to discard clusters as long they then read
>>>> back as zero (which is why you cannot simply use bdrv_pdiscard()).
>>>> However, I think this would require a new flag called
>>>> BDRV_REQ_SHOULD_UNMAP (which should imply BDRV_REQ_MAY_UNMAP).
>>>
>>> This flag doesn't make sense to me, if the protocol doesn't know how to
>>> unmap,
>>> it can ignore BDRV_REQ_MAY_UNMAP, but not BDRV_REQ_SHOULD_UNMAP. It just
>>> complicates things a little.
>>
>> I don't think we actually have a use for a "MAY" unmap flag. Either we
>> keep the not-so-perfect name or we replace MAY_UNMAP with "should" or
>> "want" or "would_like" unmap... But Fam's patch does do what was
>> intended for the flag (which is the equivalent of the UNMAP bit in the
>> SCSI WRITE SAME command).
>
> After reading rfc2119, now I agree that "SHOULD" is better. :)
That's OK with me, then.
Max
signature.asc
Description: OpenPGP digital signature
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-block] [PATCH] qcow2: Support BDRV_REQ_MAY_UNMAP,
Max Reitz <=