I'm trying to overcommit storage space on one our hypervisors (and reclaim
space if possible after memory peak times) and it seems like kernel in
Fedora 33 isn't doing automatic discard on swap partitions?  The swap is
enabled by:

  $ swapon --discard /dev/sda

The guest (on RHEL 8 HV host) is started with virtio-scsi controller to
propagate the trim requests to the host storage, the volumes I tried were
both of raw and qcow2 format.

The 'fstrim -av' isn't propagated to SWAP mount points (expected
probably).  The only thing that helps to shrink the host volume allocated
for guest swap is 'swapoff -a && swapon --discard /dev/sda' (but I assume
TRIM is sent to the driver in this case, and that the problem isn't in the
host libvirt setup).

But otherwise, freeing the guest memory manually, minimizing the swap usage,
etc. (experiments with tmpfs) doesn't result in freeing the allocated storage
blocks on host.

Am I doing something wrong, is this expected or is this a bug?

FTR, I tested "kernel-core-5.10.11-200.fc33.x86_64" and
"kernel-core-5.10.12-200.fc33.x86_64" but this is not a regression -- I'm
experimenting with TRIM in this setup for the first time.

Dmesg output seems to indicate page cluster trim is enabled (c symbol):
[ 3936.914260] Adding 33554428k swap on /dev/sda.  Priority:-2 extents:1 
across:33554428k DscFS

Thanks,
Pavel


_______________________________________________
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org

Reply via email to