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=-10.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 8D1F3C55ABD for ; Tue, 10 Nov 2020 18:16:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1621120781 for ; Tue, 10 Nov 2020 18:16:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="x2QI3PJR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1621120781 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 88C9C6B0036; Tue, 10 Nov 2020 13:16:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 83C396B005C; Tue, 10 Nov 2020 13:16:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 72D156B005D; Tue, 10 Nov 2020 13:16:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0028.hostedemail.com [216.40.44.28]) by kanga.kvack.org (Postfix) with ESMTP id 434FE6B0036 for ; Tue, 10 Nov 2020 13:16:13 -0500 (EST) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id D7EB13624 for ; Tue, 10 Nov 2020 18:16:12 +0000 (UTC) X-FDA: 77469312984.06.knife57_4f0c353272f7 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin06.hostedemail.com (Postfix) with ESMTP id B11AD10037CCF for ; Tue, 10 Nov 2020 18:16:12 +0000 (UTC) X-HE-Tag: knife57_4f0c353272f7 X-Filterd-Recvd-Size: 3139 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf09.hostedemail.com (Postfix) with ESMTP for ; Tue, 10 Nov 2020 18:16:12 +0000 (UTC) Received: from kernel.org (unknown [77.125.7.142]) (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 84AF920781; Tue, 10 Nov 2020 18:16:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605032171; bh=UyILU+nPWtEG2lkYm08D82WracQenImj1C2c66W0WzE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=x2QI3PJRPOJ8NOtvl4kIvcbBiVS+L5hqqaAt3KOkei45F7Of6tn/iveJe3A5onR4O 1rUm6e4n7ekCbmNfXeqfhSl64wl8qVls/OFPtTobiJ3mCPn/efDHmFYFsaBN6s3E48 u3qLAUypl41JS7XjizEg1Msh15FUm1vOHGrEC4wA= Date: Tue, 10 Nov 2020 20:16:05 +0200 From: Mike Rapoport To: Faiyaz Mohammed Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, vinmenon@codeaurora.org Subject: Re: [PATCH] mm: memblock: add more debug logs Message-ID: <20201110181605.GC4758@kernel.org> References: <1605010798-17545-1-git-send-email-faiyazm@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1605010798-17545-1-git-send-email-faiyazm@codeaurora.org> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000019, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi, On Tue, Nov 10, 2020 at 05:49:58PM +0530, Faiyaz Mohammed wrote: > Exact caller of memblock_phys_alloc_range is not available with > "memblock=debug". Below information is not enough for memory accounting. > for example: > [ 0.000000] memblock_reserve: [0x000000023fc6b000-0x000000023fc6bfff] memblock_alloc_range_nid+0xc0/0x188 > > To enhance the memblock_dbg information or to get the exact owner of the > memblock_reserve, add debug logs in memblock_phys_alloc_range function. Why would you want to use memblock=debug for memory accounting or for tracking of the owners of the reserved memory? > After adding logs: > [ 0.000000] memblock_phys_alloc_range: 4096 bytes align=0x1000 from=0x0000000000000000 max_addr=0x0000000000000000 early_pgtable_alloc+0x24/0x178 > [ 0.000000] memblock_reserve: [0x000000023fc6b000-0x000000023fc6bfff] memblock_alloc_range_nid+0xc0/0x188 > > Signed-off-by: Faiyaz Mohammed > --- > mm/memblock.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/mm/memblock.c b/mm/memblock.c > index 049df41..f65af9f 100644 > --- a/mm/memblock.c > +++ b/mm/memblock.c > @@ -1419,6 +1419,9 @@ phys_addr_t __init memblock_phys_alloc_range(phys_addr_t size, > phys_addr_t start, > phys_addr_t end) > { > + memblock_dbg("%s: %llu bytes align=0x%llx from=%pa max_addr=%pa %pS\n", > + __func__, (u64)size, (u64)align, &start, &end, > + (void *)_RET_IP_); > return memblock_alloc_range_nid(size, align, start, end, NUMA_NO_NODE, > false); > } > -- > QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a > member of the Code Aurora Forum, hosted by The Linux Foundation > -- Sincerely yours, Mike.