diff options
| author | Vijayanand Jitta <vjitta@codeaurora.org> | 2021-01-28 18:42:28 +1100 |
|---|---|---|
| committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2021-01-28 18:42:28 +1100 |
| commit | b9779abb09a8fea27845516ac093cabd012a697c (patch) | |
| tree | d99d89646346bfeafb603d3a4e15f14a1a02a302 /init/main.c | |
| parent | 626ee2c93e137b30926852c4b59dcde806f2e47a (diff) | |
| download | tip-b9779abb09a8.tar.gz | |
lib: stackdepot: add support to disable stack depot
Notice: this object is not reachable from any branch.
Add a kernel parameter stack_depot_disable to disable stack depot. So
that stack hash table doesn't consume any memory when stack depot is
disabled.
The use case is CONFIG_PAGE_OWNER without page_owner=on. Without this
patch, stackdepot will consume the memory for the hashtable. By default,
it's 8M which is never trivial.
With this option, in CONFIG_PAGE_OWNER configured system, page_owner=off,
stack_depot_disable in kernel command line, we could save the wasted
memory for the hashtable.
Link: https://lkml.kernel.org/r/1611749198-24316-2-git-send-email-vjitta@codeaurora.org
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
Signed-off-by: Vijayanand Jitta <vjitta@codeaurora.org>
Cc: Alexander Potapenko <glider@google.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Yogesh Lal <ylal@codeaurora.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Notice: this object is not reachable from any branch.
Diffstat (limited to 'init/main.c')
| -rw-r--r-- | init/main.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/init/main.c b/init/main.c index 1c1fd9ab608595..ba64a3cf009a32 100644 --- a/init/main.c +++ b/init/main.c @@ -98,6 +98,7 @@ #include <linux/mem_encrypt.h> #include <linux/kcsan.h> #include <linux/init_syscalls.h> +#include <linux/stackdepot.h> #include <asm/io.h> #include <asm/bugs.h> @@ -828,6 +829,7 @@ static void __init mm_init(void) init_mem_debugging_and_hardening(); kfence_alloc_pool(); report_meminit(); + stack_depot_init(); mem_init(); /* page_owner must be initialized after buddy is ready */ page_ext_init_flatmem_late(); |
