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 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 122BDC55ABD for ; Tue, 10 Nov 2020 18:42:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 65BB620797 for ; Tue, 10 Nov 2020 18:42:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="sAiBxdXG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 65BB620797 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 8DA916B0036; Tue, 10 Nov 2020 13:42:06 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8B2216B005C; Tue, 10 Nov 2020 13:42:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7A0726B005D; Tue, 10 Nov 2020 13:42:06 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0060.hostedemail.com [216.40.44.60]) by kanga.kvack.org (Postfix) with ESMTP id 4CF636B0036 for ; Tue, 10 Nov 2020 13:42:06 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id EDAF9181AEF10 for ; Tue, 10 Nov 2020 18:42:05 +0000 (UTC) X-FDA: 77469378210.13.cars62_201412f272f7 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id C3FD818140B67 for ; Tue, 10 Nov 2020 18:42:05 +0000 (UTC) X-HE-Tag: cars62_201412f272f7 X-Filterd-Recvd-Size: 3594 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Tue, 10 Nov 2020 18:42:05 +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 72B27206F1; Tue, 10 Nov 2020 18:42:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605033724; bh=VzXs8SJ8/igjWdXAhydCqALWYiTEP6ScB1g/03HJK3M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sAiBxdXGC1j2G2xc9wBe/SyCI3EZ/UuP/gtvJqvuCkWnA8ZK4ykD3XxWuSL4DUOcH x6GqCKDTm/HAXQ7CbwMXu8I7kTlQsALUpJNwcBCb7kFYNWtApa3opADVNg/bxIQeBO BoX6uEa50pLzHLRkQkUTuaehDUzaRT5nq8fxpU1Q= Date: Tue, 10 Nov 2020 20:41:57 +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: always inline memblock_alloc Message-ID: <20201110184157.GD4758@kernel.org> References: <1605010817-21065-1-git-send-email-faiyazm@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1605010817-21065-1-git-send-email-faiyazm@codeaurora.org> 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: Hi, On Tue, Nov 10, 2020 at 05:50:17PM +0530, Faiyaz Mohammed wrote: > Since memblock_alloc is not getting inlined, memblock_reserve owner info > is lost. Below information is not enough for memory accounting. > for example: > [ 0.000000] memblock_alloc_try_nid: 1490 bytes align=0x40 nid=-1 from=0x0000000000000000 max_addr=0x0000000000000000 memblock_alloc+0x20/0x2c > [ 0.000000] memblock_reserve: [0x000000023f09a3c0-0x000000023f09a991] memblock_alloc_range_nid+0xc0/0x188 > > Add "__always_inline" to make sure it get inlined and to get the exact > owner of the memblock_reserve. > After adding __always_inline: > [ 0.000000] memblock_alloc_try_nid: 1490 bytes align=0x40 nid=-1 from=0x0000000000000000 max_addr=0x0000000000000000 start_kernel+0xa4/0x568 > [ 0.000000] memblock_reserve: [0x000000023f09a3c0-0x000000023f09a991] memblock_alloc_range_nid+0xc0/0x188 I agree that making memblock_alloc() inline as well as other similar wrappers would improve the debugability. Still, it has nothing to do with memory accounting and owner tracking. Please update the patch description to better explain what it actually improves. > Signed-off-by: Faiyaz Mohammed > --- > include/linux/memblock.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/linux/memblock.h b/include/linux/memblock.h > index ef13125..54f9544 100644 > --- a/include/linux/memblock.h > +++ b/include/linux/memblock.h > @@ -404,7 +404,7 @@ void *memblock_alloc_try_nid(phys_addr_t size, phys_addr_t align, > phys_addr_t min_addr, phys_addr_t max_addr, > int nid); > > -static inline void * __init memblock_alloc(phys_addr_t size, phys_addr_t align) > +static __always_inline void * __init memblock_alloc(phys_addr_t size, phys_addr_t align) I think simply dropping __init here will make memblock_alloc() inline. There are also several more convenience wrappers marked __init, do you mind removing the __init annotation for them as well? > { > return memblock_alloc_try_nid(size, align, MEMBLOCK_LOW_LIMIT, > MEMBLOCK_ALLOC_ACCESSIBLE, NUMA_NO_NODE); -- Sincerely yours, Mike.