Skip to content

Commit

Permalink
/proc/sys/vm/compact_memory doesn't exist in Ubuntu 20.04, delete ref…
Browse files Browse the repository at this point in the history
…erence to it.

improve the handling of compact_memory

Should check that compact_memory is writeable

Signed-off-by: Chris Ward <tjcw@uk.ibm.com>
  • Loading branch information
tjcw committed Nov 5, 2021
1 parent a61ffcd commit 6f722e3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/build_kvm_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ free -m
if [[ "$vs_build_prepare_mem" == "yes" ]]; then
# Force o.s. to drop cache and compact memory so that KVM can get 2G memory
bash -c 'echo 1 > /proc/sys/vm/drop_caches'
bash -c 'echo 1 > /proc/sys/vm/compact_memory'
# Not all kernels support compact_memory
if [[ -w '/proc/sys/vm/compact_memory' ]]
then
bash -c 'echo 1 > /proc/sys/vm/compact_memory'
fi
free -m
fi

Expand Down

0 comments on commit 6f722e3

Please sign in to comment.