Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp622015pxb; Wed, 27 Jan 2021 17:05:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJxbGTfnE/dYkSEiu8vNtg97mj22a0oOmUt0KvCzqGzNWFM0xfze3+WR865avaw/N/Xk3UW2 X-Received: by 2002:aa7:d78e:: with SMTP id s14mr11475638edq.329.1611795918280; Wed, 27 Jan 2021 17:05:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611795918; cv=none; d=google.com; s=arc-20160816; b=bMFioILJ75rCETg9bprKA2eM5Z+JnHsoun/wvNnjsE6WBLv+zLlAMUCtM/+9yaqDFX /L13+Bi5silfqjRgh9dCbmOe8QSTtW37Px/OmpO4y2H66wJd5p6ov0kdMVusyzNFTFRz BgBRVZg6NalERBLaYdB6sFiiRSu43kSKT7TSUAK+Gpdf6r8m1zyAi96c9o4nuddi1Z22 2s8dV0yiVUfuhs3HEYxKN24UmnK+HrrdytRCmVJdf3dhGRM7/xPrH0c9A+ae/ON2aMdD 25N6mVVrQdXhIHy2gOFWyV8nGPpXjEC7Dfs8O+rPySesSwuKA7r1Fi4NzIXUYBwhgCku yJBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=XH+O0/bicOmKSVl+CASC/vjZKG7Z6GI4WwE59ebHs9Y=; b=Y7xTHfr6n5fFj8Bthn5TM18PpbD9K4o4IOa2NvpnmRYmUvvFvhJb8e36oMJSGfFPrb zc/ymE5XgIU7HKhPKXw6CcSipsErXSfxyzwhW0vVuc1c+iiGRXY8jhg2hQr6twQkl73E u2Mq5kZgpAdYhQ7Od1W//ZpcptTdH7GjgzQaN6F2fSM1/DVivy0iNVm71kh152T39b5+ PldlS+zfroBBdbVhNff3gIvs99YM9bFXHupv7Pju/v2H5id+RteICnozibLw7JK/dHUX hymr3nTh5v2FOMnxYzRkEWi9p+GeWi4ylpoPjUOtOYdCsZYFyxYU7pLBt9JuP3Dh+S57 5GzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=jNzKXLmz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z8si1771104edq.163.2021.01.27.17.04.53; Wed, 27 Jan 2021 17:05:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=jNzKXLmz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231448AbhA1BBe (ORCPT + 99 others); Wed, 27 Jan 2021 20:01:34 -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 _