diff options
author | Klaus Jensen <k.jensen@samsung.com> | 2020-10-14 09:55:08 +0200 |
---|---|---|
committer | Klaus Jensen <k.jensen@samsung.com> | 2021-02-08 18:55:48 +0100 |
commit | 54064e51d1e2c85e08ab64f05d12957ff65dfcd3 (patch) | |
tree | 8257f578bd71759f82398cddc066aa8c722e665d /hw/lm32 | |
parent | 54eea8d947869856133a4eba0c0cb0b17cb9a5cd (diff) | |
download | qemu-54064e51d1e2c85e08ab64f05d12957ff65dfcd3.zip qemu-54064e51d1e2c85e08ab64f05d12957ff65dfcd3.tar.gz qemu-54064e51d1e2c85e08ab64f05d12957ff65dfcd3.tar.bz2 |
hw/block/nvme: add dulbe support
Add support for reporting the Deallocated or Unwritten Logical Block
Error (DULBE).
Rely on the block status flags reported by the block layer and consider
any block with the BDRV_BLOCK_ZERO flag to be deallocated.
Multiple factors affect when a Write Zeroes command result in
deallocation of blocks.
* the underlying file system block size
* the blockdev format
* the 'discard' and 'logical_block_size' parameters
format | discard | wz (512B) wz (4KiB) wz (64KiB)
-----------------------------------------------------
qcow2 ignore n n y
qcow2 unmap n n y
raw ignore n y y
raw unmap n y y
So, this works best with an image in raw format and 4KiB LBAs, since
holes can then be punched on a per-block basis (this assumes a file
system with a 4kb block size, YMMV). A qcow2 image, uses a cluster size
of 64KiB by default and blocks will only be marked deallocated if a full
cluster is zeroed or discarded. However, this *is* consistent with the
spec since Write Zeroes "should" deallocate the block if the Deallocate
attribute is set and "may" deallocate if the Deallocate attribute is not
set. Thus, we always try to deallocate (the BDRV_REQ_MAY_UNMAP flag is
always set).
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Diffstat (limited to 'hw/lm32')
0 files changed, 0 insertions, 0 deletions