From 280359d9236586bc917fde1a74aab76c5898cb86 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 24 Aug 2023 13:09:05 -0400 Subject: [PATCH] transposefs: Only autosave-xfs 1TiB filesystems The change in https://github.com/coreos/fedora-coreos-config/pull/2320 has been very problematic for OpenShift because our default node configuration is *always* over the threshold, and that causes significant latency on instance provisioning. First, rework the reprovision threshold to operate in terms of disk size, which is much easier to explain and debug than allocation group count. (Which to be clear, *is* the real problem, but disk size is a good enough proxy for this) Then, bump the reprovision threshold to 1TiB. This is comfortably about the default OpenShift node root disk sizes, and returns us to the prior status quo. --- .../ignition-ostree-transposefs.sh | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/overlay.d/05core/usr/lib/dracut/modules.d/40ignition-ostree/ignition-ostree-transposefs.sh b/overlay.d/05core/usr/lib/dracut/modules.d/40ignition-ostree/ignition-ostree-transposefs.sh index 6f89c4007e..76de7442c3 100755 --- a/overlay.d/05core/usr/lib/dracut/modules.d/40ignition-ostree/ignition-ostree-transposefs.sh +++ b/overlay.d/05core/usr/lib/dracut/modules.d/40ignition-ostree/ignition-ostree-transposefs.sh @@ -138,14 +138,13 @@ should_autosave_rootfs() { echo 0 return fi - local agcount - eval $(xfs_info "${root_part}" | grep -o 'agcount=[0-9]*') - # Semi-arbitrarily chosen: this is roughly ~64G currently (based on initial - # ag sizing at build time) which seems like a good rootfs size at which to - # discriminate between "throwaway/short-lived systems" and "long-running - # workload systems". It's not like XFS performance is way worse at 128. - if [ "$agcount" -lt 128 ]; then - echo "Filesystem agcount is $agcount; skipping" >&2 + # Find rootfs size in KiB + local rootsize + local reprovisionsize + rootsize=$(($(stat -f -c '%b * %s / 1024' /sysroot))) + reprovisionsize=$((1024**3)) + if [ "$rootsize" -lt "$reprovisionsize" ]; then + echo "/sysroot size $rootsize KiB is less than threshold $reprovisionsize KiB; skipping" >&2 echo 0 return fi