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=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 B0D06C49ED7 for ; Fri, 20 Sep 2019 23:22:24 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 706662190F for ; Fri, 20 Sep 2019 23:22:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="gLu1SzT+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 706662190F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0C54F6B0007; Fri, 20 Sep 2019 19:22:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 075B86B0008; Fri, 20 Sep 2019 19:22:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ECD8A6B000A; Fri, 20 Sep 2019 19:22:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0092.hostedemail.com [216.40.44.92]) by kanga.kvack.org (Postfix) with ESMTP id D5BB56B0007 for ; Fri, 20 Sep 2019 19:22:23 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id 73710180AD803 for ; Fri, 20 Sep 2019 23:22:23 +0000 (UTC) X-FDA: 75956874966.25.wren20_6c222624d8a5c X-HE-Tag: wren20_6c222624d8a5c X-Filterd-Recvd-Size: 3293 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf50.hostedemail.com (Postfix) with ESMTP for ; Fri, 20 Sep 2019 23:22:22 +0000 (UTC) Received: from localhost.localdomain (c-73-223-200-170.hsd1.ca.comcast.net [73.223.200.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CC3602173E; Fri, 20 Sep 2019 23:22:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569021742; bh=FN/Lerp2b3ubf7CVg953Cj/AlJTpxRlHeVx64/izgIE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=gLu1SzT+IWoQ4F+7fwDVxfR7LVBSf1GSBfOD3/UfDDngFXw+5ozkOQ+ft4pb7Qlib L1CD8V9S7JU05U3iPcZSN7f/wptDiTuGzGHP9iLadCUqooTfeSZ0ALMikRIVIHtDV8 4shgFNjPnJVyv+wPTcJ5x5PXh/QjP/eO2Q5HKz7g= Date: Fri, 20 Sep 2019 16:22:21 -0700 From: Andrew Morton To: Catalin Marinas Cc: Qian Cai , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH -next] mm/kmemleak: record the current memory pool size Message-Id: <20190920162221.51a800630561489a7e62821a@linux-foundation.org> In-Reply-To: <20190815100215.GB9352@arrakis.emea.arm.com> References: <1565809631-28933-1-git-send-email-cai@lca.pw> <20190815100215.GB9352@arrakis.emea.arm.com> 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, 15 Aug 2019 11:02:16 +0100 Catalin Marinas wrote: > On Wed, Aug 14, 2019 at 03:07:11PM -0400, Qian Cai wrote: > > The only way to obtain the current memory pool size for a running kernel > > is to check back the kernel config file which is inconvenient. Record it > > in the kernel messages. > > > > Signed-off-by: Qian Cai > > --- > > mm/kmemleak.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/mm/kmemleak.c b/mm/kmemleak.c > > index b8bbe9ac5472..1f74f8bcb4eb 100644 > > --- a/mm/kmemleak.c > > +++ b/mm/kmemleak.c > > @@ -1967,7 +1967,8 @@ static int __init kmemleak_late_init(void) > > mutex_unlock(&scan_mutex); > > } > > > > - pr_info("Kernel memory leak detector initialized\n"); > > + pr_info("Kernel memory leak detector initialized (mem pool size: %d)\n", > > + mem_pool_free_count); > > I wouldn't actually call it the "memory pool size" as I see the size as > a constant set at config time. What about "memory pool available"? > > (even this one is not entirely accurate since we have a > mem_pool_free_list but I expect such list not to have too many elements > at the late_initcall time) > > If you change the printed string: > > Acked-by: Catalin Marinas --- a/mm/kmemleak.c~mm-kmemleak-record-the-current-memory-pool-size-fix +++ a/mm/kmemleak.c @@ -1967,7 +1967,7 @@ static int __init kmemleak_late_init(voi mutex_unlock(&scan_mutex); } - pr_info("Kernel memory leak detector initialized (mem pool size: %d)\n", + pr_info("Kernel memory leak detector initialized (mem pool available: %d)\n", mem_pool_free_count); return 0; _