Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp4153795pxb; Tue, 17 Nov 2020 12:46:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJwd5ZEtilpvB8cmYUpCKvGuhlJZQDWcQmhXccCQKTU/ECqI/qXolIToMbiTJURhEg2Z4F3H X-Received: by 2002:a50:cd84:: with SMTP id p4mr22855674edi.81.1605645972727; Tue, 17 Nov 2020 12:46:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605645972; cv=none; d=google.com; s=arc-20160816; b=fsBDj6VR3MTGOwUWhkZw88UoNr0YX1n1G2EvgnegkeOHqt4me18r9PMgnKqGd48Osq FOnyKTJQXCDBytwvUH1dZkuK/n444w5B6KE5btQ9utEEhuBZleQmgGlm3qJUDeVCIwm7 vruw+hEQLtzwnsHrpzKOOQvKtVNnq41+2el15TqpdhlJ/7oxRzUqQAHI3kr1u99XFJj2 tk2aKCUUqmp7oIJlwmf8PS2h9ENXrdpcDfp32yR1G85YxQO/G/UqQN98+ZbAOwA7OB1u NkVZH+dnrUQVfqNyEi5FuhyBcZbbYoFJZ6mY5e3/j2VkCbeDR7mb1ZnHk299QTYVEs09 3vMA== 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=duT/CyaJ82WSIZu+w/NyT8ZBnm8LYdwKsQ41CeSRpTg=; b=zRgx4o1hAoTbVZ1VPvvfC1R5QS1rYYCi8PgLYloVmvPcc2sZSf/uGNqF2rBRQXJ+kp 2TUsSBO6pnreGz0MmS4+4k51DGeC8LCuXBnmnlKYEnbBIGaGFrpNUdn0pfxJvPcXy1zw 3WJk7zodCAyiHItRN3YRbuYYvPuyNpMF7p+mbEAxhIBxTBgjUd+wp0tZEXYZ9np3yzTV Y3s4VIhYPMFfUcUlHiGg6fKuGH29xm9vXwdHp+UByfH9f2kVFJYINfElvg04vnwwMg7t Di3vD3vvX9/EsyQra2Al/Moj0nTQj3PDjhEP2lupED1LFLILfNlLgDG3sUHrg5KqDKSL hBQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GOEyU+PF; 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 a14si14287329ejf.629.2020.11.17.12.45.50; Tue, 17 Nov 2020 12:46:12 -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=GOEyU+PF; 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 S1729434AbgKQUmI (ORCPT + 99 others); Tue, 17 Nov 2020 15:42:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729301AbgKQUmH (ORCPT ); Tue, 17 Nov 2020 15:42:07 -0500 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7CECC0613CF for ; Tue, 17 Nov 2020 12:42:07 -0800 (PST) Received: by mail-pg1-x543.google.com with SMTP id j19so10018001pgg.5 for ; Tue, 17 Nov 2020 12:42:07 -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=duT/CyaJ82WSIZu+w/NyT8ZBnm8LYdwKsQ41CeSRpTg=; b=GOEyU+PFgxtJ/JlybIstLKF/zCFvMRj0HJfuZye3TWtFKPRGlcxk3Yyj3mFdDiYHoQ Oxy/iE2KCz1O2vDfls03Z3/4WckMIQuvf0zoiaN2/gsG3IwzzWalP2JCSHjYgtOG/7Tg hHQ5ejLjyxSJyU8R2LXZewWk4YJ0z9lO+94qZetH0mbnI/p/QZWM4vVEnKAqW7UnAvyb n61egTcSufMSGQQ8lQ0ceEIS/CLdxyN69LppoWwz8QqnMz0RIcaXEgV1yjE9uDQNgKGB jMZZ6B3BoyF2O+jpaCeYktquGKpjDTsNlyfYpxu9+S/Skoo2GNFazgNFc4DmGkf9a/bc EMdQ== 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=duT/CyaJ82WSIZu+w/NyT8ZBnm8LYdwKsQ41CeSRpTg=; b=NAIlnZBn4XQOneRT6vPrNSwT+AJNFFcL6jRjUwKiEITyH+Spnnmj3YqQM0y8y4eEt2 tG+Q1u9uoUNFiwKG5IhARmYjbHBRYItoyNrMpWLYV0feU7vhhNRW4O39f+xmeg1Hx3u+ SfyCTHLqmRuWiEa5hnkHhQSVTgx/gaxUdjbJJ3gXKJO8Oa68EUvPod2/QCZV3YEnd4BY /GdAxz2BMJLhdgK2pCPgC5jTg3I9tI01qofCM4BphdoAzUmUv6V+6TbXYccWPGWU5ptt eGCoea/WdABSAZL+mS2LE1JinxQ7CRrZfCgKL7Wa1zN/VEtBsjwKq4N6BGjEbc7lg4mI RW9Q== X-Gm-Message-State: AOAM531CmYf5RIvnUUi7VcdKKltqH1qj8MTHhEmYl/z89pXY9J+0JTDv Fyu7bupTo5DttvpVQVRkCZk= X-Received: by 2002:aa7:8154:0:b029:156:4b89:8072 with SMTP id d20-20020aa781540000b02901564b898072mr1240748pfn.51.1605645727311; Tue, 17 Nov 2020 12:42:07 -0800 (PST) Received: from google.com ([2620:15c:211:201:7220:84ff:fe09:5e58]) by smtp.gmail.com with ESMTPSA id r36sm19659553pgb.75.2020.11.17.12.42.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 12:42:06 -0800 (PST) Sender: Minchan Kim Date: Tue, 17 Nov 2020 12:42:04 -0800 From: Minchan Kim To: Andrew Morton Cc: Vijayanand Jitta , linux-mm , glider@google.com, Dan Williams , broonie@kernel.org, mhiramat@kernel.org, "linux-kernel@vger.kernel.org" , Yogesh Lal , Vinayak Menon Subject: Re: [PATCH] lib: stackdepot: Add support to configure STACK_HASH_SIZE Message-ID: <20201117204204.GA3905260@google.com> References: <1603372546-27118-1-git-send-email-vjitta@codeaurora.org> <282d7028-498d-50b3-37d4-2381571f9f9e@codeaurora.org> <20201112145649.3fcd9dc4d6d3db4bd26245bb@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201112145649.3fcd9dc4d6d3db4bd26245bb@linux-foundation.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 12, 2020 at 02:56:49PM -0800, Andrew Morton wrote: > On Thu, 12 Nov 2020 18:26:24 +0530 Vijayanand Jitta wrote: > > > >> 1. page_owner=off, stackdepot_stack_hash=0 -> no more wasted memory > > >> when we don't use page_owner > > >> 2. page_owner=on, stackdepot_stack_hash=8M -> reasonable hash size > > >> when we use page_owner. > > >> > > >> > > > > > > This idea looks fine to me. Andrew and others would like to hear your > > > comments as well on this before implementing. > > > > > > Thanks, > > > Vijay > > > > > > > Awaiting for comments from Andrew and others. > > I don't actually understand the problem. > > What is it about page-owner that causes stackdepot to consume > additional memory? As far as I can tell, sizeof(struct stack_record) > isn't affected by page-owner? > Thing is once we build stackdepot due to the dependency from page_owner, it will consume 8M regardless of using page_owner. #define STACK_HASH_SIZE (1L << CONFIG_STACK_HASH_ORDER_SHIFT) static struct stack_record *stack_table[STACK_HASH_SIZE] = { [0 ... STACK_HASH_SIZE - 1] = NULL }; So if we decide the size option at build time, we should consume the memory anyway regardless of page_owner enabling in runtime.