Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp640426pxb; Thu, 21 Jan 2021 16:28:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJz3Rfe6b+CpE/ANShlscF499Mbj3xCYda+/tycrnOuU2drgvW3uQ1zMVuDQhfAsX85xVvN0 X-Received: by 2002:a05:6402:318e:: with SMTP id di14mr1278197edb.223.1611275333217; Thu, 21 Jan 2021 16:28:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611275333; cv=none; d=google.com; s=arc-20160816; b=MKfgkLZdGUfo5u1fsFjjFJ9LpRoOzZbiy7zSVn1MlXhUf3f/ym+WSToFCajGnFJafZ wW830LHVzWU54rc6KwfkAXdM4jYE1X5DjXxKbEERsAgNIhAKwPWEqEeybdsXQ2mFP1Dk VCeTvPssM3EYTxuflNz/dZaNXLnhk/4rM97Yhg8WY5eJ9IefTaKYs/MEOhRagmWGx/pN R26PZCcSxg2Jgjp9yLEqMG6W3QcRXZPMBl7xAZNa2d3D73IAHPz2DMVzIBUMrG1yrCAd vWBUjmUxYVBmEL8IMmS7QRe6gjNHkD+OKKeR1voY1Zzd17UrCcmTwJr+azLfNZu72Tz7 vGNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=5feskpk9GlzD7Krs5v/HKhRDKnwIPDPivS/lanzBAu8=; b=XpPQNz5Dzu7stUjAHCjN72yZWRgI2G3t+FumFPXpPv1xk0Ln70kd1cbEKEii5qgKLP nDG1xvj8ntZ+XZQLgQrsDLeCNGN6ttZNQO7yxqd/fl0Dw3NKtqolHLtFZtOAz8beMst/ e2nF/En0tF4kLw0k/FV6U80JMK8FzFZNWpanOGObSulxGZptk4l15Acgyt92Nx2UjyN4 H5Eankom2/880XkkY6rS53gB9lKdILhh0WJzaX1kwodKwculmqGziUIOLDu5elT4bJSo DqgM+bDNgLT7MdqUmEzkD6ouCj+cH1oUnVKmKLRcpPlcl0mJukDfO9Hk6JLl6vg1xf4V zPXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hl6Jw4vm; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g5si2175953edr.43.2021.01.21.16.28.28; Thu, 21 Jan 2021 16:28:53 -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=@gmail.com header.s=20161025 header.b=hl6Jw4vm; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726533AbhAVA0f (ORCPT + 99 others); Thu, 21 Jan 2021 19:26:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726361AbhAVA0Y (ORCPT ); Thu, 21 Jan 2021 19:26:24 -0500 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7B2AC061756 for ; Thu, 21 Jan 2021 16:25:43 -0800 (PST) Received: by mail-pl1-x631.google.com with SMTP id b8so2278661plx.0 for ; Thu, 21 Jan 2021 16:25:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=5feskpk9GlzD7Krs5v/HKhRDKnwIPDPivS/lanzBAu8=; b=hl6Jw4vmpQjaXAX/JGgeAWIcC5xSkAe4iH8/Oq28KL9jWUt/n37wxuZxYDDpPTA+eW PsWIcvFoP6Un8KVQtQ9UD/pkF0GPrUMhfpQ4ULGeiETqIElv+plirQRWA0g5trgEGHrX NTyzbH09c3KzViq5XkX0YDghgqBZOSUDow3+ZH7HS7k9OaKmM0ifJ9oLGmYpZ4bpsvlm ys3GeSuXziChU5mbXifVCmw+SQ5qOke4X+ESS31YjXHS4g59vcvkDdDM5mBvEAl+qMka VjmvmNmOtlYo7mIIchEKuy/j5lt+H54n/OY8VUtUGA2m14J2Ps+JR8v8WftjIUUzUi89 3tjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=5feskpk9GlzD7Krs5v/HKhRDKnwIPDPivS/lanzBAu8=; b=D82cDztHDFWKDdPMqj73VDfh0kqKKotXf4ogs8l1R8l+ezZyn5l9j3an1qoVClM4kn BoW4CyOjc+rS9vFMTEMxoPR9FervSGzEH8dViB0NA91aeSyRX9+PFvTQ5Q4buIqrGjwc Ml7diKvH0iMB2ScSO/mMrqDPFPIgcB31D5OSpzF8XRsRiJiubby9/H80sC3UCe+QgNld LoTiZCY/boIvQi6H8OdwxPr1BOtOV740IVYw1jg3pj++YiSBPOvUCC1kqHBAIontbjNe UoAj6XOBs3Zy7mqbtzE1WPIfLsCUGFQ/PByS+GpiprNQalPAZDzRUWsgKHgn2owrh6nI D8/A== X-Gm-Message-State: AOAM533ede5Lp7omGdU+FI8vVOBrau36t3B14nwtv3gsHAZyRvCIh1vB lv5oyNAZPOBYM0NbTaWNyKA= X-Received: by 2002:a17:902:14f:b029:de:c703:3045 with SMTP id 73-20020a170902014fb02900dec7033045mr2362002plb.14.1611275143384; Thu, 21 Jan 2021 16:25:43 -0800 (PST) Received: from google.com ([2620:15c:211:201:2144:1799:e940:1da6]) by smtp.gmail.com with ESMTPSA id c23sm7103668pgc.72.2021.01.21.16.25.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Jan 2021 16:25:42 -0800 (PST) Sender: Minchan Kim Date: Thu, 21 Jan 2021 16:25:40 -0800 From: Minchan Kim To: vjitta@codeaurora.org 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 Subject: Re: [PATCH v5 2/2] lib: stackdepot: Add support to disable stack depot Message-ID: References: <1610963802-11042-1-git-send-email-vjitta@codeaurora.org> <1610963802-11042-2-git-send-email-vjitta@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1610963802-11042-2-git-send-email-vjitta@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > > Signed-off-by: Vinayak Menon > Signed-off-by: Vijayanand Jitta Please also update kernel-parameters.txt. > --- > 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? Otherwise, looks good to me. Thank you!