lib: stackdepot: add support to disable stack depot

Linux Kernel / Linux Kernel - Vijayanand Jitta [codeaurora.org] - 26 February 2021 17:41 UTC

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.

[akpm@linux-foundation.org: fix CONFIG_STACKDEPOT=n build]

Link: https://lkml.kernel.org/r/1611749198-24316-2-git-send-email-vjitta@codeaurora.org

e1fdc403349c lib: stackdepot: add support to disable stack depot
Documentation/admin-guide/kernel-parameters.txt | 6 +++++
include/linux/stackdepot.h | 9 +++++++
init/main.c | 2 ++
lib/stackdepot.c | 32 +++++++++++++++++++++----
4 files changed, 45 insertions(+), 4 deletions(-)

Upstream: git.kernel.org


  • Share