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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB984C433F5 for ; Thu, 16 Dec 2021 09:01:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D098D6B007B; Thu, 16 Dec 2021 04:00:48 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CB9446B007D; Thu, 16 Dec 2021 04:00:48 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B81D96B007E; Thu, 16 Dec 2021 04:00:48 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0177.hostedemail.com [216.40.44.177]) by kanga.kvack.org (Postfix) with ESMTP id AAA3C6B007B for ; Thu, 16 Dec 2021 04:00:48 -0500 (EST) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 766A482499B9 for ; Thu, 16 Dec 2021 09:00:38 +0000 (UTC) X-FDA: 78923061756.19.48ACEB7 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf18.hostedemail.com (Postfix) with ESMTP id F3A891C0027 for ; Thu, 16 Dec 2021 09:00:27 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A71D761C30; Thu, 16 Dec 2021 09:00:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4B70EC36AE6; Thu, 16 Dec 2021 09:00:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1639645230; bh=kuiqVx/YyBmUe4RmMtxTDJ2OH1ZH0VX7froUZKbMCFA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MjmBZk45Lwzn6uK8HvuRkz+iFFpv3463JnlPN6LRm14m+24ni11fpz5M7hWccX7JW z9+UZ2WcWzFSy222e8fEjwtC0VRLaOt4p5+kjYvlz3nhQBzSq0Ok6bzlHVJ+qNhozO wXtzseGcBXGmZNgXwmh1X47JcK57p5uIzmn4VHCFDk4UZSWMrsTJ8taBkofbbuBUju HOq6l0yS2s56+IfTQ3JiiURp5Z8LSs1QZvFf5QFyOhYJ21RAzH4DIrVQyxweCVKOf1 p+ukiaIfC5zIXqjTB2NQYxMzwsBM6WDPTtBU7l2V0xDlHhoB13X/V+NgJxrWsP4FZQ yZtavZTujb2Vw== Date: Thu, 16 Dec 2021 11:00:23 +0200 From: Mike Rapoport To: Jackie Liu Cc: akpm@linux-foundation.org, linux-mm@kvack.org Subject: Re: [PATCH] memblock: fix memblock_phys_alloc() section mismatch error Message-ID: References: <20211216011748.1079724-1-liu.yun@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211216011748.1079724-1-liu.yun@linux.dev> X-Rspamd-Queue-Id: F3A891C0027 X-Stat-Signature: 4u9hxt6ji3osis8yay6sdzg68nzae87t Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=MjmBZk45; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf18.hostedemail.com: domain of rppt@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=rppt@kernel.org X-Rspamd-Server: rspam02 X-HE-Tag: 1639645227-858071 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, Dec 16, 2021 at 09:17:48AM +0800, Jackie Liu wrote: > From: Jackie Liu > > Fix modpost Section mismatch error in memblock_phys_alloc() > > [...] > WARNING: modpost: vmlinux.o(.text.unlikely+0x1dcc): Section mismatch in reference > from the function memblock_phys_alloc() to the function .init.text:memblock_phys_alloc_range() > The function memblock_phys_alloc() references > the function __init memblock_phys_alloc_range(). > This is often because memblock_phys_alloc lacks a __init > annotation or the annotation of memblock_phys_alloc_range is wrong. > > ERROR: modpost: Section mismatches detected. > Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them. > [...] > > I have checked that the memblock_phys_alloc used in the source tree is all in > the __init section, we should also let him save it in this section. I don't know why compiler decided against inlining memblock_phys_alloc(), so better solution here would be to use __always_inline IMO. > Reported-by: k2ci > Signed-off-by: Jackie Liu > --- > 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 8adcf1fa8096..8959d43bc76b 100644 > --- a/include/linux/memblock.h > +++ b/include/linux/memblock.h > @@ -405,7 +405,7 @@ phys_addr_t memblock_alloc_range_nid(phys_addr_t size, > phys_addr_t end, int nid, bool exact_nid); > phys_addr_t memblock_phys_alloc_try_nid(phys_addr_t size, phys_addr_t align, int nid); > > -static inline phys_addr_t memblock_phys_alloc(phys_addr_t size, > +static inline phys_addr_t __init memblock_phys_alloc(phys_addr_t size, > phys_addr_t align) > { > return memblock_phys_alloc_range(size, align, 0, > -- > 2.25.1 > -- Sincerely yours, Mike.