On Thu, Nov 12, 2020 at 08:59:45PM +0100, Klaus Jensen wrote:
> From: Klaus Jensen <k.jen...@samsung.com>
> 
> Add support for the Dataset Management command and the Deallocate
> attribute. Deallocation results in discards being sent to the underlying
> block device. Whether of not the blocks are actually deallocated is
> affected by the same factors as Write Zeroes (see previous commit).
> 
>      format | discard | dsm (512B)  dsm (4KiB)  dsm (64KiB)
>     --------------------------------------------------------
>       qcow2    ignore   n           n           n
>       qcow2    unmap    n           n           y
>       raw      ignore   n           n           n
>       raw      unmap    n           y           y
> 
> Again, a raw format and 4KiB LBAs are preferable.
> 
> In order to set the Namespace Preferred Deallocate Granularity and
> Alignment fields (NPDG and NPDA), choose a sane minimum discard
> granularity of 4KiB. If we are using a passthru device supporting
> discard at a 512B granularity, user should set the discard_granularity
> property explicitly. NPDG and NPDA will also account for the
> cluster_size of the block driver if required (i.e. for QCOW2).
> 
> See NVM Express 1.3d, Section 6.7 ("Dataset Management command").

Looks good to me.

Reviewed-by: Keith Busch <kbu...@kernel.org>

Reply via email to