mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-06-03 02:10:04 +00:00
zram: add support for mem_limit
Some targets might be interested in limiting how big zram can grow. If the variable is set in /etc/default/zram file, configure it in mem_limit sysfs attribute. Signed-off-by: Sinan Kaya <okaya@kernel.org> Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
@@ -24,3 +24,8 @@ modprobe -q zram || true
|
|||||||
|
|
||||||
zramctl -a ${ZRAM_ALGORITHM} -s ${memzram}KB $device
|
zramctl -a ${ZRAM_ALGORITHM} -s ${memzram}KB $device
|
||||||
mkswap -L "zram-swap" $device
|
mkswap -L "zram-swap" $device
|
||||||
|
|
||||||
|
devname="${device##*/}"
|
||||||
|
if [ ! -z ${ZRAM_SIZE_LIMIT+x} ]; then
|
||||||
|
echo ${ZRAM_SIZE_LIMIT} > /sys/block/$devname/mem_limit
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user