post_boot: Ensure SLAB_STORE_USER is disabled for zram kmem_caches
ZRAM compression uses the linux slub allocator its internal data structures. If these internal data structure consume a lot of memory, ZRAM compression may increase memory usage, rather than decrease it as expected. Decrease the chance of this occuring by ensuring the SLAB_STORE_USER debug option is disabled. Change-Id: I4684feda94b7bebacb6218b7f979c95771b0ee10 Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
This commit is contained in:
parent
a293622e25
commit
20bc13de0e
1 changed files with 10 additions and 0 deletions
|
@ -392,6 +392,16 @@ function configure_zram_parameters() {
|
|||
else
|
||||
echo $zRamSizeBytes > /sys/block/zram0/disksize
|
||||
fi
|
||||
|
||||
# ZRAM may use more memory than it saves if SLAB_STORE_USER
|
||||
# debug option is enabled.
|
||||
if [ -e /sys/kernel/slab/zs_handle ]; then
|
||||
echo 0 > /sys/kernel/slab/zs_handle/store_user
|
||||
fi
|
||||
if [ -e /sys/kernel/slab/zspage ]; then
|
||||
echo 0 > /sys/kernel/slab/zspage/store_user
|
||||
fi
|
||||
|
||||
mkswap /dev/block/zram0
|
||||
swapon /dev/block/zram0 -p 32758
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue