* [PATCH] include/linux/memblock.h: Use __init_memblock for movable_node_is_enabled
@ 2016-01-05 22:25 chengang
2016-01-05 22:35 ` Andrew Morton
0 siblings, 1 reply; 3+ messages in thread
From: chengang @ 2016-01-05 22:25 UTC (permalink / raw)
To: akpm
Cc: will.deacon, tangchen, kuleshovmail, tony.luck, vladimir.murzin,
baiyaowei, holt, ard.biesheuvel, linux-kernel, Chen Gang,
Chen Gang
From: Chen Gang <chengang@emindsoft.com.cn>
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.
Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
---
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 173fb44..976ac58 100644
--- a/include/linux/memblock.h
+++ b/include/linux/memblock.h
@@ -160,13 +160,21 @@ void __next_reserved_mem_region(u64 *idx, phys_addr_t *out_start,
i != (u64)ULLONG_MAX; \
__next_reserved_mem_region(&i, p_start, p_end))
+#ifdef CONFIG_ARCH_DISCARD_MEMBLOCK
+#define __init_memblock __meminit
+#define __initdata_memblock __meminitdata
+#else
+#define __init_memblock
+#define __initdata_memblock
+#endif
+
#ifdef CONFIG_MOVABLE_NODE
static inline bool memblock_is_hotpluggable(struct memblock_region *m)
{
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;
}
@@ -405,14 +413,6 @@ static inline unsigned long memblock_region_reserved_end_pfn(const struct memblo
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
--
1.9.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] include/linux/memblock.h: Use __init_memblock for movable_node_is_enabled
2016-01-05 22:25 [PATCH] include/linux/memblock.h: Use __init_memblock for movable_node_is_enabled chengang
@ 2016-01-05 22:35 ` Andrew Morton
2016-01-06 0:57 ` Chen Gang
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2016-01-05 22:35 UTC (permalink / raw)
To: chengang
Cc: will.deacon, tangchen, kuleshovmail, tony.luck, vladimir.murzin,
baiyaowei, holt, ard.biesheuvel, linux-kernel, Chen Gang
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" <kirill.shutemov@linux.intel.com>
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 <kirill.shutemov@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
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
_
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] include/linux/memblock.h: Use __init_memblock for movable_node_is_enabled
2016-01-05 22:35 ` Andrew Morton
@ 2016-01-06 0:57 ` Chen Gang
0 siblings, 0 replies; 3+ messages in thread
From: Chen Gang @ 2016-01-06 0:57 UTC (permalink / raw)
To: Andrew Morton
Cc: will.deacon, tangchen, kuleshovmail, tony.luck, vladimir.murzin,
baiyaowei, holt, ard.biesheuvel, linux-kernel
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" <kirill.shutemov@linux.intel.com>
> 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 <kirill.shutemov@linux.intel.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
>
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-01-06 0:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-05 22:25 [PATCH] include/linux/memblock.h: Use __init_memblock for movable_node_is_enabled chengang
2016-01-05 22:35 ` Andrew Morton
2016-01-06 0:57 ` Chen Gang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).