* [PATCH 1/2] mm/nobootmem.c: make CONFIG_NO_BOOTMEM depend on CONFIG_HAVE_MEMBLOCK
@ 2016-08-27 15:27 zijun_hu
2016-08-28 7:48 ` kbuild test robot
2016-08-29 13:25 ` zijun_hu
0 siblings, 2 replies; 4+ messages in thread
From: zijun_hu @ 2016-08-27 15:27 UTC (permalink / raw)
To: Andrew Morton, mingo; +Cc: linux-mm, linux-kernel, zijun_hu
From: zijun_hu <zijun_hu@htc.com>
this patch fixes the following bugs:
- no bootmem is implemented by memblock currently, but config option
CONFIG_NO_BOOTMEM doesn't depend on CONFIG_HAVE_MEMBLOCK
- the same ARCH_LOW_ADDRESS_LIMIT statements are duplicated between
header and relevant source
- don't ensure ARCH_LOW_ADDRESS_LIMIT perhaps defined by ARCH in
asm/processor.h is preferred over default in linux/bootmem.h
completely since the former header isn't included by the latter
Signed-off-by: zijun_hu <zijun_hu@htc.com>
---
include/linux/bootmem.h | 13 +++++++------
mm/Kconfig | 6 ++++--
mm/nobootmem.c | 6 +-----
3 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
index f9be32691718..95968236abc7 100644
--- a/include/linux/bootmem.h
+++ b/include/linux/bootmem.h
@@ -7,6 +7,7 @@
#include <linux/mmzone.h>
#include <linux/mm_types.h>
#include <asm/dma.h>
+#include <asm/processor.h>
/*
* simple boot-time physical memory area allocator.
@@ -119,6 +120,10 @@ extern void *__alloc_bootmem_low_node(pg_data_t *pgdat,
#define BOOTMEM_LOW_LIMIT __pa(MAX_DMA_ADDRESS)
#endif
+#ifndef ARCH_LOW_ADDRESS_LIMIT
+#define ARCH_LOW_ADDRESS_LIMIT 0xffffffffUL
+#endif
+
#define alloc_bootmem(x) \
__alloc_bootmem(x, SMP_CACHE_BYTES, BOOTMEM_LOW_LIMIT)
#define alloc_bootmem_align(x, align) \
@@ -148,7 +153,7 @@ extern void *__alloc_bootmem_low_node(pg_data_t *pgdat,
__alloc_bootmem_low_node(pgdat, x, PAGE_SIZE, 0)
-#if defined(CONFIG_HAVE_MEMBLOCK) && defined(CONFIG_NO_BOOTMEM)
+#if defined(CONFIG_NO_BOOTMEM)
/* FIXME: use MEMBLOCK_ALLOC_* variants here */
#define BOOTMEM_ALLOC_ACCESSIBLE 0
@@ -180,10 +185,6 @@ static inline void * __init memblock_virt_alloc_nopanic(
NUMA_NO_NODE);
}
-#ifndef ARCH_LOW_ADDRESS_LIMIT
-#define ARCH_LOW_ADDRESS_LIMIT 0xffffffffUL
-#endif
-
static inline void * __init memblock_virt_alloc_low(
phys_addr_t size, phys_addr_t align)
{
@@ -333,7 +334,7 @@ static inline void __init memblock_free_late(
{
free_bootmem_late(base, size);
}
-#endif /* defined(CONFIG_HAVE_MEMBLOCK) && defined(CONFIG_NO_BOOTMEM) */
+#endif /* defined(CONFIG_NO_BOOTMEM) */
#ifdef CONFIG_HAVE_ARCH_ALLOC_REMAP
extern void *alloc_remap(int nid, unsigned long size);
diff --git a/mm/Kconfig b/mm/Kconfig
index be0ee11fa0d9..b7f19ff4b743 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -144,14 +144,16 @@ config ARCH_DISCARD_MEMBLOCK
bool
config NO_BOOTMEM
- bool
+ bool "No legacy boot memory"
+ depends on HAVE_MEMBLOCK
+ help
+ NO_BOOTMEM is implemented by memblock
config MEMORY_ISOLATION
bool
config MOVABLE_NODE
bool "Enable to assign a node which has only movable memory"
- depends on HAVE_MEMBLOCK
depends on NO_BOOTMEM
depends on X86_64
depends on NUMA
diff --git a/mm/nobootmem.c b/mm/nobootmem.c
index bd05a70f44b9..1802c9bbe11a 100644
--- a/mm/nobootmem.c
+++ b/mm/nobootmem.c
@@ -11,15 +11,14 @@
#include <linux/init.h>
#include <linux/pfn.h>
#include <linux/slab.h>
-#include <linux/bootmem.h>
#include <linux/export.h>
#include <linux/kmemleak.h>
#include <linux/range.h>
#include <linux/memblock.h>
+#include <linux/bootmem.h>
#include <asm/bug.h>
#include <asm/io.h>
-#include <asm/processor.h>
#include "internal.h"
@@ -395,9 +394,6 @@ void * __init __alloc_bootmem_node_high(pg_data_t *pgdat, unsigned long size,
return __alloc_bootmem_node(pgdat, size, align, goal);
}
-#ifndef ARCH_LOW_ADDRESS_LIMIT
-#define ARCH_LOW_ADDRESS_LIMIT 0xffffffffUL
-#endif
/**
* __alloc_bootmem_low - allocate low boot memory
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] mm/nobootmem.c: make CONFIG_NO_BOOTMEM depend on CONFIG_HAVE_MEMBLOCK
2016-08-27 15:27 [PATCH 1/2] mm/nobootmem.c: make CONFIG_NO_BOOTMEM depend on CONFIG_HAVE_MEMBLOCK zijun_hu
@ 2016-08-28 7:48 ` kbuild test robot
2016-08-29 13:24 ` zijun_hu
2016-08-29 13:25 ` zijun_hu
1 sibling, 1 reply; 4+ messages in thread
From: kbuild test robot @ 2016-08-28 7:48 UTC (permalink / raw)
To: zijun_hu
Cc: kbuild-all, Andrew Morton, mingo, linux-mm, linux-kernel, zijun_hu
[-- Attachment #1: Type: text/plain, Size: 1894 bytes --]
Hi zijun_hu,
[auto build test ERROR on mmotm/master]
[also build test ERROR on v4.8-rc3 next-20160825]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
[Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on]
[Check https://git-scm.com/docs/git-format-patch for more information]
url: https://github.com/0day-ci/linux/commits/zijun_hu/mm-nobootmem-c-make-CONFIG_NO_BOOTMEM-depend-on-CONFIG_HAVE_MEMBLOCK/20160827-233707
base: git://git.cmpxchg.org/linux-mmotm.git master
config: mips-allmodconfig (attached as .config)
compiler: mips-linux-gnu-gcc (Debian 5.4.0-6) 5.4.0 20160609
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=mips
All errors (new ones prefixed by >>):
arch/mips/built-in.o: In function `setup_arch':
>> (.init.text+0x1ff4): undefined reference to `init_bootmem_node'
arch/mips/built-in.o: In function `setup_arch':
>> (.init.text+0x2144): undefined reference to `reserve_bootmem'
arch/mips/built-in.o: In function `setup_arch':
(.init.text+0x21a8): undefined reference to `reserve_bootmem'
arch/mips/built-in.o: In function `setup_arch':
(.init.text+0x2220): undefined reference to `reserve_bootmem'
arch/mips/built-in.o: In function `setup_arch':
(.init.text+0x22a4): undefined reference to `reserve_bootmem'
arch/mips/built-in.o: In function `setup_arch':
(.init.text+0x22d8): undefined reference to `reserve_bootmem'
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 43142 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] mm/nobootmem.c: make CONFIG_NO_BOOTMEM depend on CONFIG_HAVE_MEMBLOCK
2016-08-28 7:48 ` kbuild test robot
@ 2016-08-29 13:24 ` zijun_hu
0 siblings, 0 replies; 4+ messages in thread
From: zijun_hu @ 2016-08-29 13:24 UTC (permalink / raw)
To: kbuild test robot
Cc: zijun_hu, kbuild-all, Andrew Morton, mingo, linux-mm, linux-kernel
i am sorry, this patch has many bugs
i resend it in another mail thread
please ignore it
On 2016/8/28 15:48, kbuild test robot wrote:
> Hi zijun_hu,
>
> [auto build test ERROR on mmotm/master]
> [also build test ERROR on v4.8-rc3 next-20160825]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
> [Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on]
> [Check https://git-scm.com/docs/git-format-patch for more information]
>
> url: https://github.com/0day-ci/linux/commits/zijun_hu/mm-nobootmem-c-make-CONFIG_NO_BOOTMEM-depend-on-CONFIG_HAVE_MEMBLOCK/20160827-233707
> base: git://git.cmpxchg.org/linux-mmotm.git master
> config: mips-allmodconfig (attached as .config)
> compiler: mips-linux-gnu-gcc (Debian 5.4.0-6) 5.4.0 20160609
> reproduce:
> wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # save the attached .config to linux build tree
> make.cross ARCH=mips
>
> All errors (new ones prefixed by >>):
>
> arch/mips/built-in.o: In function `setup_arch':
>>> (.init.text+0x1ff4): undefined reference to `init_bootmem_node'
> arch/mips/built-in.o: In function `setup_arch':
>>> (.init.text+0x2144): undefined reference to `reserve_bootmem'
> arch/mips/built-in.o: In function `setup_arch':
> (.init.text+0x21a8): undefined reference to `reserve_bootmem'
> arch/mips/built-in.o: In function `setup_arch':
> (.init.text+0x2220): undefined reference to `reserve_bootmem'
> arch/mips/built-in.o: In function `setup_arch':
> (.init.text+0x22a4): undefined reference to `reserve_bootmem'
> arch/mips/built-in.o: In function `setup_arch':
> (.init.text+0x22d8): undefined reference to `reserve_bootmem'
>
> ---
> 0-DAY kernel test infrastructure Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all Intel Corporation
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] mm/nobootmem.c: make CONFIG_NO_BOOTMEM depend on CONFIG_HAVE_MEMBLOCK
2016-08-27 15:27 [PATCH 1/2] mm/nobootmem.c: make CONFIG_NO_BOOTMEM depend on CONFIG_HAVE_MEMBLOCK zijun_hu
2016-08-28 7:48 ` kbuild test robot
@ 2016-08-29 13:25 ` zijun_hu
1 sibling, 0 replies; 4+ messages in thread
From: zijun_hu @ 2016-08-29 13:25 UTC (permalink / raw)
To: Andrew Morton, mingo; +Cc: linux-mm, linux-kernel, zijun_hu
i am sorry, this patch has many bugs
i resend it in another mail thread
please ignore it
On 2016/8/27 23:27, zijun_hu wrote:
> From: zijun_hu <zijun_hu@htc.com>
>
> this patch fixes the following bugs:
>
> - no bootmem is implemented by memblock currently, but config option
> CONFIG_NO_BOOTMEM doesn't depend on CONFIG_HAVE_MEMBLOCK
>
> - the same ARCH_LOW_ADDRESS_LIMIT statements are duplicated between
> header and relevant source
>
> - don't ensure ARCH_LOW_ADDRESS_LIMIT perhaps defined by ARCH in
> asm/processor.h is preferred over default in linux/bootmem.h
> completely since the former header isn't included by the latter
>
> Signed-off-by: zijun_hu <zijun_hu@htc.com>
> ---
> include/linux/bootmem.h | 13 +++++++------
> mm/Kconfig | 6 ++++--
> mm/nobootmem.c | 6 +-----
> 3 files changed, 12 insertions(+), 13 deletions(-)
>
> diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
> index f9be32691718..95968236abc7 100644
> --- a/include/linux/bootmem.h
> +++ b/include/linux/bootmem.h
> @@ -7,6 +7,7 @@
> #include <linux/mmzone.h>
> #include <linux/mm_types.h>
> #include <asm/dma.h>
> +#include <asm/processor.h>
>
> /*
> * simple boot-time physical memory area allocator.
> @@ -119,6 +120,10 @@ extern void *__alloc_bootmem_low_node(pg_data_t *pgdat,
> #define BOOTMEM_LOW_LIMIT __pa(MAX_DMA_ADDRESS)
> #endif
>
> +#ifndef ARCH_LOW_ADDRESS_LIMIT
> +#define ARCH_LOW_ADDRESS_LIMIT 0xffffffffUL
> +#endif
> +
> #define alloc_bootmem(x) \
> __alloc_bootmem(x, SMP_CACHE_BYTES, BOOTMEM_LOW_LIMIT)
> #define alloc_bootmem_align(x, align) \
> @@ -148,7 +153,7 @@ extern void *__alloc_bootmem_low_node(pg_data_t *pgdat,
> __alloc_bootmem_low_node(pgdat, x, PAGE_SIZE, 0)
>
>
> -#if defined(CONFIG_HAVE_MEMBLOCK) && defined(CONFIG_NO_BOOTMEM)
> +#if defined(CONFIG_NO_BOOTMEM)
>
> /* FIXME: use MEMBLOCK_ALLOC_* variants here */
> #define BOOTMEM_ALLOC_ACCESSIBLE 0
> @@ -180,10 +185,6 @@ static inline void * __init memblock_virt_alloc_nopanic(
> NUMA_NO_NODE);
> }
>
> -#ifndef ARCH_LOW_ADDRESS_LIMIT
> -#define ARCH_LOW_ADDRESS_LIMIT 0xffffffffUL
> -#endif
> -
> static inline void * __init memblock_virt_alloc_low(
> phys_addr_t size, phys_addr_t align)
> {
> @@ -333,7 +334,7 @@ static inline void __init memblock_free_late(
> {
> free_bootmem_late(base, size);
> }
> -#endif /* defined(CONFIG_HAVE_MEMBLOCK) && defined(CONFIG_NO_BOOTMEM) */
> +#endif /* defined(CONFIG_NO_BOOTMEM) */
>
> #ifdef CONFIG_HAVE_ARCH_ALLOC_REMAP
> extern void *alloc_remap(int nid, unsigned long size);
> diff --git a/mm/Kconfig b/mm/Kconfig
> index be0ee11fa0d9..b7f19ff4b743 100644
> --- a/mm/Kconfig
> +++ b/mm/Kconfig
> @@ -144,14 +144,16 @@ config ARCH_DISCARD_MEMBLOCK
> bool
>
> config NO_BOOTMEM
> - bool
> + bool "No legacy boot memory"
> + depends on HAVE_MEMBLOCK
> + help
> + NO_BOOTMEM is implemented by memblock
>
> config MEMORY_ISOLATION
> bool
>
> config MOVABLE_NODE
> bool "Enable to assign a node which has only movable memory"
> - depends on HAVE_MEMBLOCK
> depends on NO_BOOTMEM
> depends on X86_64
> depends on NUMA
> diff --git a/mm/nobootmem.c b/mm/nobootmem.c
> index bd05a70f44b9..1802c9bbe11a 100644
> --- a/mm/nobootmem.c
> +++ b/mm/nobootmem.c
> @@ -11,15 +11,14 @@
> #include <linux/init.h>
> #include <linux/pfn.h>
> #include <linux/slab.h>
> -#include <linux/bootmem.h>
> #include <linux/export.h>
> #include <linux/kmemleak.h>
> #include <linux/range.h>
> #include <linux/memblock.h>
> +#include <linux/bootmem.h>
>
> #include <asm/bug.h>
> #include <asm/io.h>
> -#include <asm/processor.h>
>
> #include "internal.h"
>
> @@ -395,9 +394,6 @@ void * __init __alloc_bootmem_node_high(pg_data_t *pgdat, unsigned long size,
> return __alloc_bootmem_node(pgdat, size, align, goal);
> }
>
> -#ifndef ARCH_LOW_ADDRESS_LIMIT
> -#define ARCH_LOW_ADDRESS_LIMIT 0xffffffffUL
> -#endif
>
> /**
> * __alloc_bootmem_low - allocate low boot memory
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-08-29 13:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-27 15:27 [PATCH 1/2] mm/nobootmem.c: make CONFIG_NO_BOOTMEM depend on CONFIG_HAVE_MEMBLOCK zijun_hu
2016-08-28 7:48 ` kbuild test robot
2016-08-29 13:24 ` zijun_hu
2016-08-29 13:25 ` zijun_hu
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).