mirror of
git://git.openembedded.org/meta-openembedded
synced 2026-01-01 13:58:06 +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:
parent
a7d0d87854
commit
cb1cf05378
|
|
@ -24,3 +24,8 @@ modprobe -q zram || true
|
|||
|
||||
zramctl -a ${ZRAM_ALGORITHM} -s ${memzram}KB $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
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user