mm: save wasted memory by slab [1/1]
authortao zeng <tao.zeng@amlogic.com>
Wed, 14 Nov 2018 02:29:45 +0000 (10:29 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Tue, 18 Dec 2018 07:10:21 +0000 (23:10 -0800)
commit6af3c846c085cc6ddfb7597510ed9ea7af6c9e9a
tree330741aa956b6d564e198e62d27717fe98b6d189
parent1b264ff2330e2713fbb3646a59398b09138becae
mm: save wasted memory by slab [1/1]

PD#SWPL-1767

Problem:
When driver/kernel call kmalloc with large size, memory may waste
if size is not equal to 2^n. For example, driver call kmalloc with
size 129KB, kmalloc will allocate a 256KB memory block to caller.
Then 127kb memory will be wasted if this caller don't free it.

Solution:
Free tail of slab memory if size is not match to 2^n. This change
can save about 900KB memory after boot, and more than 100KB during
run time.

Verify:
P212

Change-Id: Iba378792ec30003358b64384361c0f0c4c2800d8
Signed-off-by: tao zeng <tao.zeng@amlogic.com>
drivers/amlogic/memory_ext/aml_cma.c
drivers/amlogic/memory_ext/page_trace.c
include/linux/amlogic/page_trace.h
mm/page_alloc.c
mm/slab_common.c
mm/slub.c