mm: optimize thread stack usage on arm64 [1/1]
authortao zeng <tao.zeng@amlogic.com>
Mon, 15 Oct 2018 07:20:38 +0000 (15:20 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Thu, 6 Dec 2018 10:57:50 +0000 (02:57 -0800)
commit0d3f347e10196157c27158dd6b49aa59ec33d22c
treec06ecfaaefcfb9bb77d9fe8488f1c23c1c7c445a
parent2df699286924bee8f23851bade5f39c67c5e925a
mm: optimize thread stack usage on arm64 [1/1]

PD#SWPL-1219

Problem:
On arm64, thread stack is 16KB for each task. If running task number
is large, this type of memory may over 40MB. It's a large amount on
small memory platform. But most case thread only use less 4KB stack.
It's waste of memory and we need optimize it.

Solution:
1. Pre-allocate a vmalloc address space for task stack;
2. Only map 1st page for stack and handle page fault in EL1
   when stack growth triggered exception;
3. handle stack switch for exception.

Verify:
p212

Change-Id: I47f511ccfa2868d982bc10a820ed6435b6d52ba9
Signed-off-by: tao zeng <tao.zeng@amlogic.com>
16 files changed:
MAINTAINERS
arch/arm64/kernel/entry.S
arch/arm64/kernel/hw_breakpoint.c
arch/arm64/kernel/smp.c
arch/arm64/kernel/stacktrace.c
arch/arm64/kernel/traps.c
drivers/amlogic/memory_ext/Kconfig
drivers/amlogic/memory_ext/Makefile
drivers/amlogic/memory_ext/vmap_stack.c [new file with mode: 0644]
drivers/amlogic/pm/gx_pm.c
fs/proc/meminfo.c
include/linux/amlogic/vmap_stack.h [new file with mode: 0644]
include/linux/sched.h
include/linux/vmalloc.h
kernel/fork.c
mm/vmalloc.c