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=-12.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,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 E22FFC2D0E4 for ; Tue, 17 Nov 2020 15:49:23 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 670492465E for ; Tue, 17 Nov 2020 15:49:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="uoKSHeNZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 670492465E 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 B5E5B6B0074; Tue, 17 Nov 2020 10:49:22 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B10786B0075; Tue, 17 Nov 2020 10:49:22 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9FDBB6B0078; Tue, 17 Nov 2020 10:49:22 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0109.hostedemail.com [216.40.44.109]) by kanga.kvack.org (Postfix) with ESMTP id 6F3A26B0074 for ; Tue, 17 Nov 2020 10:49:22 -0500 (EST) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 1BB61180AD804 for ; Tue, 17 Nov 2020 15:49:22 +0000 (UTC) X-FDA: 77494344564.04.cord25_240aab827332 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin04.hostedemail.com (Postfix) with ESMTP id F1B39800294B for ; Tue, 17 Nov 2020 15:49:21 +0000 (UTC) X-HE-Tag: cord25_240aab827332 X-Filterd-Recvd-Size: 6089 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf28.hostedemail.com (Postfix) with ESMTP for ; Tue, 17 Nov 2020 15:49:21 +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 C5EF1238E6; Tue, 17 Nov 2020 15:49:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605628160; bh=V7uAi+aLeukcM7TUcb2w4CrWhvmHsv3w1Wej+B0peII=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uoKSHeNZiJheXNIXJF/OS81rfr1rkxrJvMLwHzyU9mMDRA3bzwkhi3VutTwvU+cfN XIr8KFedg88Ld4d7aR7uAbcWpqBHjSbrdu173J0VbrSTMznrAoSJzgvVUY+wk7B/vU jKcs7JOVRzG0+TuT2+mbLYZR5XLR09iANcsxx1cQ= Date: Tue, 17 Nov 2020 17:49:14 +0200 From: Mike Rapoport To: Faiyaz Mohammed Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, vinmenon@codeaurora.org Subject: Re: [PATCH v2] mm: memblock: drop __init from memblock functions to make it inline Message-ID: <20201117154914.GI370813@kernel.org> References: <1605526537-16166-1-git-send-email-faiyazm@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1605526537-16166-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: On Mon, Nov 16, 2020 at 05:05:37PM +0530, Faiyaz Mohammed wrote: > __init is used with inline due to which memblock wraper functions are > not getting inline. > 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 > > Dropping __init from memblock wrapper functions to make it inline and it > increase the debugability. > After: > [ 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 > > Signed-off-by: Faiyaz Mohammed Applied, thanks! I've updated memblock_alloc() to be __always_inline because some configurations make kbuild happy without it. >> WARNING: modpost: vmlinux.o(.text.unlikely+0xbde): Section mismatch in reference from the function memblock_alloc() to the function .init.text:memblock_alloc_try_nid() The function memblock_alloc() references the function __init memblock_alloc_try_nid(). This is often because memblock_alloc lacks a __init annotation or the annotation of memblock_alloc_try_nid is wrong. > --- > include/linux/memblock.h | 18 +++++++++--------- > 1 file changed, 9 insertions(+), 9 deletions(-) > > diff --git a/include/linux/memblock.h b/include/linux/memblock.h > index ef13125..f78113f 100644 > --- a/include/linux/memblock.h > +++ b/include/linux/memblock.h > @@ -404,13 +404,13 @@ 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 inline void *memblock_alloc(phys_addr_t size, phys_addr_t align) > { > return memblock_alloc_try_nid(size, align, MEMBLOCK_LOW_LIMIT, > MEMBLOCK_ALLOC_ACCESSIBLE, NUMA_NO_NODE); > } > > -static inline void * __init memblock_alloc_raw(phys_addr_t size, > +static inline void *memblock_alloc_raw(phys_addr_t size, > phys_addr_t align) > { > return memblock_alloc_try_nid_raw(size, align, MEMBLOCK_LOW_LIMIT, > @@ -418,7 +418,7 @@ static inline void * __init memblock_alloc_raw(phys_addr_t size, > NUMA_NO_NODE); > } > > -static inline void * __init memblock_alloc_from(phys_addr_t size, > +static inline void *memblock_alloc_from(phys_addr_t size, > phys_addr_t align, > phys_addr_t min_addr) > { > @@ -426,33 +426,33 @@ static inline void * __init memblock_alloc_from(phys_addr_t size, > MEMBLOCK_ALLOC_ACCESSIBLE, NUMA_NO_NODE); > } > > -static inline void * __init memblock_alloc_low(phys_addr_t size, > +static inline void *memblock_alloc_low(phys_addr_t size, > phys_addr_t align) > { > return memblock_alloc_try_nid(size, align, MEMBLOCK_LOW_LIMIT, > ARCH_LOW_ADDRESS_LIMIT, NUMA_NO_NODE); > } > > -static inline void * __init memblock_alloc_node(phys_addr_t size, > +static inline void *memblock_alloc_node(phys_addr_t size, > phys_addr_t align, int nid) > { > return memblock_alloc_try_nid(size, align, MEMBLOCK_LOW_LIMIT, > MEMBLOCK_ALLOC_ACCESSIBLE, nid); > } > > -static inline void __init memblock_free_early(phys_addr_t base, > +static inline void memblock_free_early(phys_addr_t base, > phys_addr_t size) > { > memblock_free(base, size); > } > > -static inline void __init memblock_free_early_nid(phys_addr_t base, > +static inline void memblock_free_early_nid(phys_addr_t base, > phys_addr_t size, int nid) > { > memblock_free(base, size); > } > > -static inline void __init memblock_free_late(phys_addr_t base, phys_addr_t size) > +static inline void memblock_free_late(phys_addr_t base, phys_addr_t size) > { > __memblock_free_late(base, size); > } > @@ -460,7 +460,7 @@ static inline void __init memblock_free_late(phys_addr_t base, phys_addr_t size) > /* > * Set the allocation direction to bottom-up or top-down. > */ > -static inline void __init memblock_set_bottom_up(bool enable) > +static inline void memblock_set_bottom_up(bool enable) > { > memblock.bottom_up = enable; > } > -- > 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.