From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BFFCDC433DB for ; Thu, 28 Jan 2021 01:02:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7BCC364DD0 for ; Thu, 28 Jan 2021 01:02:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231247AbhA1BBo (ORCPT ); Wed, 27 Jan 2021 20:01:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:34156 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229831AbhA1A6d (ORCPT ); Wed, 27 Jan 2021 19:58:33 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 03E0E61492; Thu, 28 Jan 2021 00:57:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1611795462; bh=GmiQS9jbtp67wxyW//Qr7OOg3keGiSKqCrr+Cvr/THQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=jNzKXLmzl9LiQ21rTP0SVfohiEwxUxkWxj0ZvFfUqDClO67LIsQuTyZfG9aiheu5P BOcpcXor8txN0iXnkXOwGMmebCn/mlI9XHa+zjel4dFDcr0fXOC/nln9Ln4DA1/DSz fdLxLlePGrOYRaRkJW9KT4zgNLnAuly6cAIHXZOo= Date: Wed, 27 Jan 2021 16:57:40 -0800 From: Andrew Morton 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 Message-Id: <20210127165740.d3546f332ed49c5570b06057@linux-foundation.org> In-Reply-To: <1611749198-24316-2-git-send-email-vjitta@codeaurora.org> References: <1611749198-24316-1-git-send-email-vjitta@codeaurora.org> <1611749198-24316-2-git-send-email-vjitta@codeaurora.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 _