linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: vjitta@codeaurora.org
Cc: minchan@kernel.org, glider@google.com, dan.j.williams@intel.com,
	broonie@kernel.org, mhiramat@kernel.org,
	linux-kernel@vger.kernel.org, ylal@codeaurora.org,
	vinmenon@codeaurora.org
Subject: Re: [PATCH v6 2/2] lib: stackdepot: Add support to disable stack depot
Date: Wed, 27 Jan 2021 16:57:40 -0800	[thread overview]
Message-ID: <20210127165740.d3546f332ed49c5570b06057@linux-foundation.org> (raw)
In-Reply-To: <1611749198-24316-2-git-send-email-vjitta@codeaurora.org>

On Wed, 27 Jan 2021 17:36:38 +0530 vjitta@codeaurora.org wrote:

> 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 usecase 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.

CONFIG_STACKDEPOT=n:

main.c:(.init.text+0x4c1): undefined reference to `stack_depot_init'


--- a/include/linux/stackdepot.h~lib-stackdepot-add-support-to-disable-stack-depot-fix
+++ a/include/linux/stackdepot.h
@@ -21,5 +21,13 @@ unsigned int stack_depot_fetch(depot_sta
 
 unsigned int filter_irq_stacks(unsigned long *entries, unsigned int nr_entries);
 
+#ifdef CONFIG_STACKDEPOT
 int stack_depot_init(void);
+#else
+static inline int stack_depot_init(void)
+{
+	return 0;
+}
+#endif	/* CONFIG_STACKDEPOT */
+
 #endif
_


      reply	other threads:[~2021-01-28  1:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-27 12:06 [PATCH v6 1/2] lib: stackdepot: Add support to configure STACK_HASH_SIZE vjitta
2021-01-27 12:06 ` [PATCH v6 2/2] lib: stackdepot: Add support to disable stack depot vjitta
2021-01-28  0:57   ` Andrew Morton [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210127165740.d3546f332ed49c5570b06057@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=broonie@kernel.org \
    --cc=dan.j.williams@intel.com \
    --cc=glider@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=minchan@kernel.org \
    --cc=vinmenon@codeaurora.org \
    --cc=vjitta@codeaurora.org \
    --cc=ylal@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).