add TRIM/UNMAP support
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest5 patches 16 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | block: add discard supportblock.c block.h block/ +1 more | +20 | 2 replies | |
| 1/5 | block: add discard supportblock.c block.h block/ +1 more | +22 | 8 replies | |
| 2/5 | scsi-disk: support WRITE SAME (16) with unmap bithw/ hw/ | +48 | 1 reply | |
| 2/5 | scsi-disk: support WRITE SAME (16) with unmap bithw/ hw/ | +50 | 0 replies | |
| 3/5 | make dma_bdrv_io available to driversdma-helpers.c dma.h | +18 | 0 replies | |
| 3/5 | make dma_bdrv_io available to driversdma-helpers.c dma.h | +18 | 0 replies | |
| 4/5 | ide: add TRIM supporthw/ hw/ hw/ | +150 | 1 reply | |
| 4/5 | ide: add TRIM supporthw/ hw/ hw/ | +150 | 2 replies | |
| 5/5 | raw-posix: add discard supportblock/ configure | +70 | 0 replies | |
| 5/5 | raw-posix: add discard supportblock/ configure | +70 | 1 reply |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [Qemu-devel] [PATCH 0/5] add TRIM/UNMAP support
This patchset adds support for the ATA TRIM and SCSI WRITE SAME with unmap commands, which allow reclaiming free space from a backing image.
The user facing implementation is pretty complete, but not really efficient because the underlying bdrv_discard implementation doesn't use the aio implementation yet. The reason for that is that the SCSI layer doesn't really allow any asynchronous commands except for READ/WRITE by design, and implementing the ATA TRIM command with it's multiple ranges is rather painful, and combined with the SCSI limitation I didn't bother yet. The only backend support so far is the XFS hole punching ioctl, but others can be added easily when they become available. A virtio implementation for a discard command would also be pretty easy, but until we actually support a better backend then a plain sparse file it's not worth using for production enviroments anyway, but more for playing with the thin provisioning infrastructure, or observing guest behaviour when TRIM / unmap is supported.
If the support is enabled and the backend doesn't support hole punching the TRIM / WRITE SAME commands become no-ops so that migration from hosts supporting or not supporting it works.