[OpenWrt-Devel] [PATCH v2] zram-swap: set a high priority for the swap

Juan Orti Alcaine j.orti.alcaine at gmail.com
Fri May 29 15:51:15 EDT 2015


The zram swap must be activated with a higher priority than
disk-based swap, so it is used before any other.
This patch activates the zram-based swap with a priority of 100.

---
v2:
  Fallback to no priority when swapon doesn't support it.

Signed-off-by: Juan Orti Alcaine <j.orti.alcaine at gmail.com>
---
 package/system/zram-swap/files/zram.init | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/system/zram-swap/files/zram.init b/package/system/zram-swap/files/zram.init
index 23de915..b26ee0d 100644
--- a/package/system/zram-swap/files/zram.init
+++ b/package/system/zram-swap/files/zram.init
@@ -100,7 +100,7 @@ start()
 		zram_reset "$zram_dev" "enforcing defaults"
 		echo $(( $zram_size * 1024 * 1024 )) >"/sys/block/$( basename $zram_dev )/disksize"
 		mkswap "$zram_dev"
-		swapon "$zram_dev"
+		swapon -p 100 "$zram_dev"
 	} done
 }
 
-- 
2.4.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list