From 490827fe3a5f62e490a36d617d7dc1f70fb6447d Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 15 Jun 2021 09:36:44 -0400 Subject: [PATCH] Allow memory reclamation through deletion When going to zram, things were solid for space reduction as data was written, however memory could no longer be reclaimed. It turns out that zram supports TRIM, and by telling xfs discard, we have it do trim-on-demand. It is by default off out of performance concerns, but I don't think that applies to a zram backed filesystem. --- .../el8-diskless/profiles/default/scripts/imageboot.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/confluent_osdeploy/el8-diskless/profiles/default/scripts/imageboot.sh b/confluent_osdeploy/el8-diskless/profiles/default/scripts/imageboot.sh index 6588b377..d49a6174 100644 --- a/confluent_osdeploy/el8-diskless/profiles/default/scripts/imageboot.sh +++ b/confluent_osdeploy/el8-diskless/profiles/default/scripts/imageboot.sh @@ -14,7 +14,7 @@ memtot=$(grep ^MemTotal: /proc/meminfo|awk '{print $2}') memtot=$((memtot/2))$(grep ^MemTotal: /proc/meminfo | awk '{print $3'}) echo $memtot > /sys/block/zram0/disksize mkfs.xfs /dev/zram0 > /dev/null -mount /dev/zram0 /mnt/overlay +mount -o discard /dev/zram0 /mnt/overlay mkdir -p /mnt/overlay/upper /mnt/overlay/work mount -t overlay -o upperdir=/mnt/overlay/upper,workdir=/mnt/overlay/work,lowerdir=/mnt/remote disklessroot /sysroot mkdir -p /sysroot/etc/ssh