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)
committerLuan Yuan <luan.yuan@amlogic.com>
Thu, 20 Dec 2018 03:24:49 +0000 (11:24 +0800)
commit8d9a99ec3d93af30bede1581d598cf756ed321af
tree9c66ece43424feb159037352c26d29636e726448
parent0a2065c9390b96a9fff5e394a304c956ee6f3fc4
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