Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp739845pxb; Thu, 21 Jan 2021 20:06:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJzw6CLBho413oFGfACFm9LGiSRJGDXXnZ3NLNfViUlH9c48iNZ/I/AqhA9AepQHVcedLlWQ X-Received: by 2002:a17:906:b082:: with SMTP id x2mr1623651ejy.100.1611288371752; Thu, 21 Jan 2021 20:06:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611288371; cv=none; d=google.com; s=arc-20160816; b=ZwDGLDQ6T0Dumcx3D0hHdNxmmsloXU2LSnLGpgvT7iIr27i+zChPcs6VhkNSC0qiCg Rhk1kMOuJAW/7SWpZmplSQzLNqcA7jysFuy/87fNk09IbfRHmKY/hWR5FsLNKtWbtm9v e1PO9ZM/tFBFh1JlUUU7y8BWVRP2F6KRdmDlu26X3E4VqDuRaQcXsrULuty+yH0/mlYq l5C5XQF7BPYw/tz4fFcIHScALsGQsOHvAuRF2NNgy+rUou1SnMhf+Y2vBqHpzxSgVdiH SMd9X+9EO/LzuTG6w5HzNFdx93p7vXTaMIcVE9FO9EBZd03mCGvE3ykTvEAU+YrRgGan gw7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dmarc-filter:sender:dkim-signature; bh=lYiG4Vq3amaV9qOUs9f8gykH1QLqDSir3sXlu0FfLdU=; b=Opr/iLFFjEZ5tIGOyglKwlDkGzGuejP68urQ7Nvur8OFUx2A5FaxTxZiKkOTWzCbpg Xd28dNYNfB19dwMxGz8HlBMHJxlCIVbsmOq25TSlqD0Vso12DwLeddOl6DYab1/xctW2 5Uu9LiXGrdmSt0hJ/RUFZQVXAKChfa/v1ZycZOtzFTdfqNYrXjL4GR2GWTHrNM8/lNRZ X701WhWU99CRCatitQw8j0BqOcKLMzuK5TuO20uNPP5zGnPx0mvfGQV/9xR/WSeGpKRh a3gJIPXSKXL640HAp+BwIH7DJQsZil+7iFlZa+7cjPBJQ0KMwEkg+YPRurU2YE8clL64 Oy+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=kmqepppt; 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 h21si2980608edw.448.2021.01.21.20.05.48; Thu, 21 Jan 2021 20:06:11 -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=@mg.codeaurora.org header.s=smtp header.b=kmqepppt; 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 S1726884AbhAVEEI (ORCPT + 99 others); Thu, 21 Jan 2021 23:04:08 -0500 Received: from m42-8.mailgun.net ([69.72.42.8]:17072 "EHLO m42-8.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726686AbhAVEDb (ORCPT ); Thu, 21 Jan 2021 23:03:31 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1611288191; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=lYiG4Vq3amaV9qOUs9f8gykH1QLqDSir3sXlu0FfLdU=; b=kmqepppt8ywDpEXr8JM2+81VjjzVEo/TkNccNFrHmqjQ8DhUX4nMEMWHSyyLIrXYXPo/siBI GZacJwRtYkrqWeyWVYsI+tl8IRg/JuHKNiWNCYc94idb3m21QGglwF4d7XsmMHdZnzbX//gM 8L+8Rzcm3gjGdQs+U6uwKlZEhzI= X-Mailgun-Sending-Ip: 69.72.42.8 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n05.prod.us-west-2.postgun.com with SMTP id 600a4e7c5677aca7bdec23a2 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Fri, 22 Jan 2021 04:03:08 GMT Sender: vjitta=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 6F4A0C43461; Fri, 22 Jan 2021 04:03:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00, NICE_REPLY_A,SPF_FAIL,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from [192.168.0.106] (unknown [182.18.191.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: vjitta) by smtp.codeaurora.org (Postfix) with ESMTPSA id 9E38DC433CA; Fri, 22 Jan 2021 04:03:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 9E38DC433CA Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=vjitta@codeaurora.org Subject: Re: [PATCH v5 2/2] lib: stackdepot: Add support to disable stack depot To: Minchan Kim Cc: glider@google.com, akpm@linux-foundation.org, dan.j.williams@intel.com, broonie@kernel.org, mhiramat@kernel.org, linux-kernel@vger.kernel.org, ylal@codeaurora.org, vinmenon@codeaurora.org References: <1610963802-11042-1-git-send-email-vjitta@codeaurora.org> <1610963802-11042-2-git-send-email-vjitta@codeaurora.org> From: Vijayanand Jitta Message-ID: <45c640f3-9a38-8ed1-634a-8561c34a4a17@codeaurora.org> Date: Fri, 22 Jan 2021 09:33:00 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/22/2021 5:55 AM, Minchan Kim wrote: > On Mon, Jan 18, 2021 at 03:26:42PM +0530, vjitta@codeaurora.org wrote: >> From: Vijayanand Jitta >> >> 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. > Sure, will update the commit text with above details. >> >> Signed-off-by: Vinayak Menon >> Signed-off-by: Vijayanand Jitta > > Please also update kernel-parameters.txt. > Sure. >> --- >> include/linux/stackdepot.h | 1 + >> init/main.c | 2 ++ >> lib/stackdepot.c | 33 +++++++++++++++++++++++++++++---- >> 3 files changed, 32 insertions(+), 4 deletions(-) >> >> diff --git a/include/linux/stackdepot.h b/include/linux/stackdepot.h >> index 24d49c7..eafd9aa 100644 >> --- a/include/linux/stackdepot.h >> +++ b/include/linux/stackdepot.h >> @@ -21,4 +21,5 @@ unsigned int stack_depot_fetch(depot_stack_handle_t handle, >> >> unsigned int filter_irq_stacks(unsigned long *entries, unsigned int nr_entries); >> >> +int stack_depot_init(void); >> #endif >> diff --git a/init/main.c b/init/main.c >> index 32b2a8a..8fcf9bb 100644 >> --- a/init/main.c >> +++ b/init/main.c >> @@ -98,6 +98,7 @@ >> #include >> #include >> #include >> +#include >> >> #include >> #include >> @@ -827,6 +828,7 @@ static void __init mm_init(void) >> page_ext_init_flatmem(); >> init_debug_pagealloc(); >> report_meminit(); >> + stack_depot_init(); >> mem_init(); >> kmem_cache_init(); >> kmemleak_init(); >> diff --git a/lib/stackdepot.c b/lib/stackdepot.c >> index dff8521..d20e6fd 100644 >> --- a/lib/stackdepot.c >> +++ b/lib/stackdepot.c >> @@ -31,6 +31,8 @@ >> #include >> #include >> #include >> +#include > > Why do we need vmalloc? > Its not needed, will remove it. > Otherwise, looks good to me. > Thank you! > Thanks for the review. Thanks, Vijay -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation