qemu-block
[Top][All Lists]
Advanced

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

Re: [PATCH 0/2] block: propagate discard alignment from format drivers t


From: Denis V. Lunev
Subject: Re: [PATCH 0/2] block: propagate discard alignment from format drivers to the guest
Date: Fri, 19 Jun 2020 19:27:42 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0

On 6/19/20 7:20 PM, Eduardo Habkost wrote:
> On Thu, Jun 11, 2020 at 08:16:06PM +0300, Denis V. Lunev wrote:
>> Nowaday SCSI drivers in guests are able to align UNMAP requests before
>> sending to the device. Right now QEMU provides an ability to set
>> this via "discard_granularity" property of the block device which could
>> be used by management layer.
>>
>> Though, in particular, from the point of QEMU, there is
>> pdiscard_granularity on the format driver level, f.e. on QCOW2 or iSCSI.
>> It would be beneficial to pass this value as a default for this
>> property.
> I assume the value is visible to the guest.  What is supposed to
> happen if live migrating and the block backend is a different one
> on the destination?
>
> Also, don't we have mechanisms to change the block backend change
> at run time?  What should happen in that case?
First of all, I think that this should be very rare case.
Though nothing bad is expected. The quest will see
old value, i.e. one negotiated at guest startup.

Let us assume that block backend has been changed
and discard alignment is
- less than set. In this case the guest will continue to
  send larger than possible requests, i.e. some blocks
  will not be discarded as it could happen. This will
  happen until the guest restarts and see smaller
  alignment. First re-trim will discard all non-discarded
  so far blocks
- greater than set. The code will work like now, i.e.
  some extra requests will be sent.

Den



reply via email to

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