[Vdo-devel] [BUG] Discard not working

Bryan Gurney bgurney at redhat.com
Wed Aug 8 14:49:26 UTC 2018


On Wed, Aug 8, 2018 at 7:55 AM, Michael Niewöhner <foss at mniewoehner.de> wrote:
> Hi all,
>
> I just realized there's a mailing list so I forward that Github issue [1] here.
> It seems discard does not work properly.
>
>
> OS: Debian 9
> Kernel: 4.17.0-0.bpo.1-amd64
> VDO: 6.2.0.187
>
>
> Test Setup 1 (no VDO): disks->ZFS->ZVOL->ext4
> Steps:
>
> - create ext4 on VDO, mount with discard option
> - zfs list shows ~0G referenced
> - create 2G file
> - zfs list shows ~2.1G referenced
> - delete 2G file
> - zfs list shows ~0G referenced
>
> This is expected behavior.
>
>
> Test Setup 2 (with VDO): disks->ZFS->ZVOL->VDO->ext4
> Steps:
>
> - create ext4 on VDO, mount with discard option
> - zfs list shows ~0G referenced
> - create 2G file
> - zfs list shows ~2.1G referenced
> - delete 2G file
> - zfs list shows unchanged ~2.1G referenced
>
>
> Looks like discard did not work. Let's discard manually:
>
> - fstrim on ext4
> - zfs list shows unchanged ~2.1G referenced
> - unmount ext4
> - blkdiscard on vdo
> - zfs list shows unchanged ~2.1G referenced
>
>
> One more thing I noticed is that blkdiscard takes just about 10 seconds directly
> on zvol but minutes on VDO.
>
>
>
> [1] https://github.com/dm-vdo/kvdo/issues/12
>
>
> Best regards
> Michael


Hi Michael,

VDO does not pass down discards to the layer below (i.e.: to the
device specified in "vdo create --device=<devicepath> ...").

However, sending discards to a VDO volume does reclaim space on the
VDO volume.  I sent an email in February 18 detailing the strategy of
using the discard mount option versus fstrim [1], which may help.

[1] https://www.redhat.com/archives/vdo-devel/2018-February/msg00009.html


Thanks,

Bryan Gurney,
Senior Software Engineer, VDO
Red Hat




More information about the vdo-devel mailing list