mm: optimize for CMA allocate time
authortao zeng <tao.zeng@amlogic.com>
Sat, 24 Feb 2018 07:40:59 +0000 (15:40 +0800)
committerYixun Lan <yixun.lan@amlogic.com>
Mon, 5 Mar 2018 07:34:36 +0000 (15:34 +0800)
commit718776ccb5e6f01303da5e576cc76cda6b81af39
treea634ea4e846aa86598df0bcb91752be8617ae5c0
parentacffc9179b87b9625bf62ec00aa67e23b90d0e49
mm: optimize for CMA allocate time

PD#159608: mm: optimize for CMA allocate time

1. Make all amlogic-changed mm code configuarable, which are
   wrapped by CONFIG_AMLOGIC_CMA/CONFIG_AMLOGIC_MEMORY_EXTEND
2. Implement some core code of CMA to a single file:
   drivers/amlogic/memory_ext/aml_cma.c
3. detailed imporove steps:
  a) use NOOP as default IO-scheduler for nand based storage.
    which can avoid long time wait for page lock found in
    CFQ scheduler;
  b) use per-cpu thread to allocate CMA concurrent when driver
    request large amount CMA memory; these threads have high
    user nice value to reduce schedule delay;
  c) increase task user nice of mmc queue and kswapd.
  d) wake up kswapd if page are hold by kswap shrink list and
    cma isolated test failed.
  e) Fobidden low user nice task use CMA, which can avoid priority
    inversion problem.
  f) optimize for LRU usage, devide each type of LRU to 2 parts,
    normal pages are linked after LRU head, CMA pages are linked
    after cma_list.
  g) avoid compaction case move cma forbidden pages to cma area.
  h) Increase strength of lowmemory killer.

4. Improve read speed of /proc/pagetrace, a filter can be set to
   reduce message which not print functions allocate memory less
   than filter value:

   echo filter=xxx > /proc/pagetrace

Change-Id: Ie79288b7947aa642e4f7eacc25565559a73660df
Signed-off-by: tao zeng <tao.zeng@amlogic.com>
27 files changed:
MAINTAINERS
drivers/amlogic/memory_ext/Kconfig
drivers/amlogic/memory_ext/Makefile
drivers/amlogic/memory_ext/aml_cma.c [new file with mode: 0644]
drivers/amlogic/memory_ext/aml_slub_debug.c [new file with mode: 0644]
drivers/amlogic/memory_ext/page_trace.c
drivers/mmc/card/queue.c
drivers/staging/android/lowmemorykiller.c
fs/block_dev.c
include/linux/amlogic/aml_cma.h [new file with mode: 0644]
include/linux/amlogic/page_trace.h
include/linux/cma.h
include/linux/gfp.h
include/linux/mm_inline.h
include/linux/mmzone.h
include/linux/vmstat.h
mm/cma.c
mm/compaction.c
mm/internal.h
mm/mmzone.c
mm/page_alloc.c
mm/page_isolation.c
mm/readahead.c
mm/slab_common.c
mm/swap.c
mm/vmscan.c
mm/vmstat.c