awk internally uses float for every calculation, printing a large float
with awk results in 1.233e+09 format which causes the script to fail afterwards.
Instead I am printing the float without decimals.
Signed-off-by: Stefan Lendl <s.lendl@proxmox.com>
--- /dev/null
+--- ksm-control-scripts/ksmtuned 2024-01-25 11:33:03.485039813 +0100
++++ ksm-control-scripts.new/ksmtuned 2024-01-25 11:37:40.544751316 +0100
+@@ -72,11 +72,11 @@
+ # calculate how much memory is committed to running qemu processes
+ local progname
+ progname=${1:-kvm}
+- ps -C "$progname" -o rsz | awk '{ sum += $1 }; END { print sum }'
++ ps -C "$progname" -o rsz | awk '{ sum += $1 }; END { printf ("%.0f", sum) }'
+ }
+
+ free_memory () {
+- awk '/^(MemFree|Buffers|Cached):/ {free += $2}; END {print free}' \
++ awk '/^(MemFree|Buffers|Cached):/ {free += $2}; END { printf ("%.0f", free) }' \
+ /proc/meminfo
+ }
+
init-script.diff
ksmtuned.diff
adjust-ksm-slepp.diff
+awk-printf.diff