From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752533AbcAFA6o (ORCPT ); Tue, 5 Jan 2016 19:58:44 -0500 Received: from mail113-249.mail.alibaba.com ([205.204.113.249]:53709 "EHLO us-alimail-mta2.hst.scl.en.alidc.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752415AbcAFA6m (ORCPT ); Tue, 5 Jan 2016 19:58:42 -0500 X-Alimail-AntiSpam: AC=CONTINUE;BC=0.0768712|-1;FP=0|0|0|0|0|-1|-1|-1;HT=e01l04444;MF=chengang@emindsoft.com.cn;NM=1;PH=DS;RN=11;RT=10;SR=0;TI=SMTPD_----4QLvHYz_1452041876; Subject: Re: [PATCH] include/linux/memblock.h: Use __init_memblock for movable_node_is_enabled To: Andrew Morton References: <1452032756-10196-1-git-send-email-chengang@emindsoft.com.cn> <20160105143546.7b3aa50adbac72daf8c09540@linux-foundation.org> Cc: will.deacon@arm.com, tangchen@cn.fujitsu.com, kuleshovmail@gmail.com, tony.luck@intel.com, vladimir.murzin@arm.com, baiyaowei@cmss.chinamobile.com, holt@sgi.com, ard.biesheuvel@linaro.org, linux-kernel@vger.kernel.org From: Chen Gang Message-ID: <568C6694.5050601@emindsoft.com.cn> Date: Wed, 6 Jan 2016 08:57:56 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <20160105143546.7b3aa50adbac72daf8c09540@linux-foundation.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org OK, thanks. And I shall try to send another patches for mm within this month. On 2016年01月06日 06:35, Andrew Morton wrote: > On Wed, 6 Jan 2016 06:25:56 +0800 chengang@emindsoft.com.cn wrote: > >> The related warning: >> >> LD mm/built-in.o >> WARNING: mm/built-in.o(.text.unlikely+0x155d): Section mismatch in reference from the function movable_node_is_enabled() to the variable .meminit.data:movable_node_enabled >> The function movable_node_is_enabled() references >> the variable __meminitdata movable_node_enabled. >> This is often because movable_node_is_enabled lacks a __meminitdata >> annotation or the annotation of movable_node_enabled is wrong. > > Thanks. Kirill just sent (almost) the same patch: > > > > From: "Kirill A. Shutemov" > Subject: memblock: fix section mismatch > > allmodconfig produces following warning for me: > > WARNING: vmlinux.o(.text.unlikely+0x10314): Section mismatch in reference from the function movable_node_is_enabled() to the variable .meminit.data:movable_node_enabled > The function movable_node_is_enabled() references > the variable __meminitdata movable_node_enabled. > This is often because movable_node_is_enabled lacks a __meminitdata > annotation or the annotation of movable_node_enabled is wrong. > > Let's mark the function with __meminit. It fixes the warning. > > Signed-off-by: Kirill A. Shutemov > Signed-off-by: Andrew Morton > --- > > include/linux/memblock.h | 18 +++++++++--------- > 1 file changed, 9 insertions(+), 9 deletions(-) > > diff -puN include/linux/memblock.h~memblock-fix-section-mismatch include/linux/memblock.h > --- a/include/linux/memblock.h~memblock-fix-section-mismatch > +++ a/include/linux/memblock.h > @@ -60,6 +60,14 @@ extern int memblock_debug; > extern bool movable_node_enabled; > #endif /* CONFIG_MOVABLE_NODE */ > > +#ifdef CONFIG_ARCH_DISCARD_MEMBLOCK > +#define __init_memblock __meminit > +#define __initdata_memblock __meminitdata > +#else > +#define __init_memblock > +#define __initdata_memblock > +#endif > + > #define memblock_dbg(fmt, ...) \ > if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) > > @@ -164,7 +172,7 @@ static inline bool memblock_is_hotplugga > return m->flags & MEMBLOCK_HOTPLUG; > } > > -static inline bool movable_node_is_enabled(void) > +static inline bool __init_memblock movable_node_is_enabled(void) > { > return movable_node_enabled; > } > @@ -397,14 +405,6 @@ static inline unsigned long memblock_reg > for (idx = 0; idx < memblock_type->cnt; \ > idx++,rgn = &memblock_type->regions[idx]) > > -#ifdef CONFIG_ARCH_DISCARD_MEMBLOCK > -#define __init_memblock __meminit > -#define __initdata_memblock __meminitdata > -#else > -#define __init_memblock > -#define __initdata_memblock > -#endif > - > #ifdef CONFIG_MEMTEST > extern void early_memtest(phys_addr_t start, phys_addr_t end); > #else > _ > > -- Chen Gang (陈刚) Open, share, and attitude like air, water, and life which God blessed