From abc61c3112c64d693fbe55dc422b2fe1f8999fbe Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Fri, 15 Oct 2010 05:50:36 +0200 Subject: [PATCH] busybox: setup 'swappiness' related to installed memory Signed-off-by: Stephan Raue --- packages/sysutils/busybox/init.d/09_swapfile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/sysutils/busybox/init.d/09_swapfile b/packages/sysutils/busybox/init.d/09_swapfile index 38c11a5377..e004459209 100755 --- a/packages/sysutils/busybox/init.d/09_swapfile +++ b/packages/sysutils/busybox/init.d/09_swapfile @@ -40,5 +40,15 @@ if [ $INSTALLED_MEMORY -le 500000 ]; then fi progress "enable swapfile" - swapon $HOME/.cache/swapfile + swapon -p 10000 $HOME/.cache/swapfile + + [ $INSTALLED_MEMORY -le 260000 ] \ + && sysctl -w vm.swappiness=100 \ + || sysctl -w vm.swappiness=60 + +else + + sysctl -w vm.swappiness=0 + fi +