* [PATCH 0/2] Fix two boot problems related to ZONE_MOVABLE sizing
@ 2007-04-24 18:00 Mel Gorman
2007-04-24 18:00 ` [PATCH 1/2] Handle kernelcore= boot parameter in common code to avoid boot problem on IA64 Mel Gorman
2007-04-24 18:01 ` [PATCH 2/2] Align ZONE_MOVABLE to a MAX_ORDER_NR_PAGES boundary Mel Gorman
0 siblings, 2 replies; 5+ messages in thread
From: Mel Gorman @ 2007-04-24 18:00 UTC (permalink / raw)
To: akpm; +Cc: Mel Gorman, linux-kernel, linux-mm, apw, y-goto, kamezawa.hiroyu
Following this mail are two fixes related to a boot problem in relation
to ZONE_MOVABLE. These are fixes for memory partitioning where kernelcore=
is used and is unrelated to grouping pages by mobility.
The first patch moves kernelcore= parsing to common code. This avoids an
infinite loop that can occur when booting on IA64. As a side-effect,
it extends support of kernelcore= to all architectures that use
architecture-independent zone-sizing.
The second patch aligns ZONE_MOVABLE correctly. The bootmem allocator makes
assumptions on the alignment of zones. This can cause pages to be placed
on the freelists for the wrong zone resulting in a BUG() later. Aligning
ZONE_MOVABLE avoids the problem.
They have been successfully boot-tested with and without kernelcore=
specified on x86_64, ppc64 and IA64 (where the bug was first triggered).
--
Mel Gorman
Part-time Phd Student Linux Technology Center
University of Limerick IBM Dublin Software Lab
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] Handle kernelcore= boot parameter in common code to avoid boot problem on IA64
2007-04-24 18:00 [PATCH 0/2] Fix two boot problems related to ZONE_MOVABLE sizing Mel Gorman
@ 2007-04-24 18:00 ` Mel Gorman
2007-04-24 21:04 ` Andrew Morton
2007-04-24 18:01 ` [PATCH 2/2] Align ZONE_MOVABLE to a MAX_ORDER_NR_PAGES boundary Mel Gorman
1 sibling, 1 reply; 5+ messages in thread
From: Mel Gorman @ 2007-04-24 18:00 UTC (permalink / raw)
To: akpm; +Cc: Mel Gorman, linux-kernel, linux-mm, apw, y-goto, kamezawa.hiroyu
When "kernelcore" boot option is specified, kernel can't boot up on ia64
because of an infinite loop. In addition, the parsing code can be handled
in an architecture-independent manner.
This patch patches uses common code to handle the kernelcore= parameter.
It is only available to architectures that support arch-independent
zone-sizing (i.e. define CONFIG_ARCH_POPULATES_NODE_MAP). Other architectures
will ignore the boot parameter.
This effectively removes the following arch-specific patches;
ia64-specify-amount-of-kernel-memory-at-boot-time.patch
ppc-and-powerpc-specify-amount-of-kernel-memory-at-boot-time.patch
x86_64-specify-amount-of-kernel-memory-at-boot-time.patch
x86-specify-amount-of-kernel-memory-at-boot-time.patch
Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>
Acked-by: Mel Gorman <mel@csn.ul.ie>
Acked-by: Andy Whitcroft <apw@shadowen.org>
---
arch/i386/kernel/setup.c | 1 -
arch/ia64/kernel/efi.c | 2 --
arch/powerpc/kernel/prom.c | 1 -
arch/ppc/mm/init.c | 2 --
arch/x86_64/kernel/e820.c | 1 -
include/linux/mm.h | 1 -
mm/page_alloc.c | 4 +++-
7 files changed, 3 insertions(+), 9 deletions(-)
Index: kernelcore/arch/ia64/kernel/efi.c
===================================================================
--- kernelcore.orig/arch/ia64/kernel/efi.c 2007-04-24 15:09:37.000000000 +0900
+++ kernelcore/arch/ia64/kernel/efi.c 2007-04-24 15:25:22.000000000 +0900
@@ -423,8 +423,6 @@ efi_init (void)
mem_limit = memparse(cp + 4, &cp);
} else if (memcmp(cp, "max_addr=", 9) == 0) {
max_addr = GRANULEROUNDDOWN(memparse(cp + 9, &cp));
- } else if (memcmp(cp, "kernelcore=",11) == 0) {
- cmdline_parse_kernelcore(cp+11);
} else if (memcmp(cp, "min_addr=", 9) == 0) {
min_addr = GRANULEROUNDDOWN(memparse(cp + 9, &cp));
} else {
Index: kernelcore/arch/i386/kernel/setup.c
===================================================================
--- kernelcore.orig/arch/i386/kernel/setup.c 2007-04-24 15:29:20.000000000 +0900
+++ kernelcore/arch/i386/kernel/setup.c 2007-04-24 15:29:39.000000000 +0900
@@ -195,7 +195,6 @@ static int __init parse_mem(char *arg)
return 0;
}
early_param("mem", parse_mem);
-early_param("kernelcore", cmdline_parse_kernelcore);
#ifdef CONFIG_PROC_VMCORE
/* elfcorehdr= specifies the location of elf core header
Index: kernelcore/arch/powerpc/kernel/prom.c
===================================================================
--- kernelcore.orig/arch/powerpc/kernel/prom.c 2007-04-24 15:04:47.000000000 +0900
+++ kernelcore/arch/powerpc/kernel/prom.c 2007-04-24 15:30:25.000000000 +0900
@@ -431,7 +431,6 @@ static int __init early_parse_mem(char *
return 0;
}
early_param("mem", early_parse_mem);
-early_param("kernelcore", cmdline_parse_kernelcore);
/*
* The device tree may be allocated below our memory limit, or inside the
Index: kernelcore/arch/ppc/mm/init.c
===================================================================
--- kernelcore.orig/arch/ppc/mm/init.c 2007-04-24 15:04:47.000000000 +0900
+++ kernelcore/arch/ppc/mm/init.c 2007-04-24 15:30:56.000000000 +0900
@@ -214,8 +214,6 @@ void MMU_setup(void)
}
}
-early_param("kernelcore", cmdline_parse_kernelcore);
-
/*
* MMU_init sets up the basic memory mappings for the kernel,
* including both RAM and possibly some I/O regions,
Index: kernelcore/arch/x86_64/kernel/e820.c
===================================================================
--- kernelcore.orig/arch/x86_64/kernel/e820.c 2007-04-24 15:04:47.000000000 +0900
+++ kernelcore/arch/x86_64/kernel/e820.c 2007-04-24 15:34:02.000000000 +0900
@@ -604,7 +604,6 @@ static int __init parse_memopt(char *p)
return 0;
}
early_param("mem", parse_memopt);
-early_param("kernelcore", cmdline_parse_kernelcore);
static int userdef __initdata;
Index: kernelcore/include/linux/mm.h
===================================================================
--- kernelcore.orig/include/linux/mm.h 2007-04-24 15:09:37.000000000 +0900
+++ kernelcore/include/linux/mm.h 2007-04-24 15:35:52.000000000 +0900
@@ -1051,7 +1051,6 @@ extern unsigned long find_max_pfn_with_a
extern void free_bootmem_with_active_regions(int nid,
unsigned long max_low_pfn);
extern void sparse_memory_present_with_active_regions(int nid);
-extern int cmdline_parse_kernelcore(char *p);
#ifndef CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID
extern int early_pfn_to_nid(unsigned long pfn);
#endif /* CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID */
Index: kernelcore/mm/page_alloc.c
===================================================================
--- kernelcore.orig/mm/page_alloc.c 2007-04-24 15:09:37.000000000 +0900
+++ kernelcore/mm/page_alloc.c 2007-04-24 16:00:21.000000000 +0900
@@ -3728,6 +3728,9 @@ int __init cmdline_parse_kernelcore(char
return 0;
}
+
+early_param("kernelcore", cmdline_parse_kernelcore);
+
#endif /* CONFIG_ARCH_POPULATES_NODE_MAP */
/**
--
Yasunori Goto
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/2] Align ZONE_MOVABLE to a MAX_ORDER_NR_PAGES boundary
2007-04-24 18:00 [PATCH 0/2] Fix two boot problems related to ZONE_MOVABLE sizing Mel Gorman
2007-04-24 18:00 ` [PATCH 1/2] Handle kernelcore= boot parameter in common code to avoid boot problem on IA64 Mel Gorman
@ 2007-04-24 18:01 ` Mel Gorman
2007-04-25 2:00 ` Yasunori Goto
1 sibling, 1 reply; 5+ messages in thread
From: Mel Gorman @ 2007-04-24 18:01 UTC (permalink / raw)
To: akpm; +Cc: Mel Gorman, linux-kernel, linux-mm, apw, y-goto, kamezawa.hiroyu
The boot memory allocator makes assumptions on the alignment of zone
boundaries even though the buddy allocator has no requirements on the
alignment of zones. This may cause boot problems in situations where
ZONE_MOVABLE is populated because the bootmem allocator assumes zones are
at least order-log2(BITS_PER_LONG) aligned. As the two potential users
(huge pages and memory hot-remove) of ZONE_MOVABLE would prefer a higher
alignment, this patch aligns the start of the zone instead of fixing the
different assumptions made by the bootmem allocator.
This patch rounds the start of ZONE_MOVABLE in each node to a
MAX_ORDER_NR_PAGES boundary. If the rounding pushes the start of ZONE_MOVABLE
above the end of the node then the zone will contain no memory and will not
be used at runtime. The value is rounded up instead of down as it is
better to have the kernel-portion of memory larger than requested instead
of smaller. The impact is that the kernel-usable portion of memory because a
minimum guarantee instead of the exact size requested by the user.
Signed-off-by: Mel Gorman <mel@csn.ul.ie>
Acked-by: Andy Whitcroft <apw@shadowen.org>
---
page_alloc.c | 5 +++++
1 files changed, 5 insertions(+)
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc6-mm1-002_commonparse/mm/page_alloc.c linux-2.6.21-rc6-mm1-003_alignmovable/mm/page_alloc.c
--- linux-2.6.21-rc6-mm1-002_commonparse/mm/page_alloc.c 2007-04-24 09:38:30.000000000 +0100
+++ linux-2.6.21-rc6-mm1-003_alignmovable/mm/page_alloc.c 2007-04-24 11:15:40.000000000 +0100
@@ -3642,6 +3642,11 @@ restart:
usable_nodes--;
if (usable_nodes && required_kernelcore > usable_nodes)
goto restart;
+
+ /* Align start of ZONE_MOVABLE on all nids to MAX_ORDER_NR_PAGES */
+ for (nid = 0; nid < MAX_NUMNODES; nid++)
+ zone_movable_pfn[nid] =
+ roundup(zone_movable_pfn[nid], MAX_ORDER_NR_PAGES);
}
/**
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] Handle kernelcore= boot parameter in common code to avoid boot problem on IA64
2007-04-24 18:00 ` [PATCH 1/2] Handle kernelcore= boot parameter in common code to avoid boot problem on IA64 Mel Gorman
@ 2007-04-24 21:04 ` Andrew Morton
0 siblings, 0 replies; 5+ messages in thread
From: Andrew Morton @ 2007-04-24 21:04 UTC (permalink / raw)
To: Mel Gorman; +Cc: linux-kernel, linux-mm, apw, y-goto, kamezawa.hiroyu
On Tue, 24 Apr 2007 19:00:52 +0100 (IST) Mel Gorman <mel@csn.ul.ie> wrote:
>
> When "kernelcore" boot option is specified, kernel can't boot up on ia64
> because of an infinite loop. In addition, the parsing code can be handled
> in an architecture-independent manner.
>
> This patch patches uses common code to handle the kernelcore= parameter.
> It is only available to architectures that support arch-independent
> zone-sizing (i.e. define CONFIG_ARCH_POPULATES_NODE_MAP). Other architectures
> will ignore the boot parameter.
>
> This effectively removes the following arch-specific patches;
>
> ia64-specify-amount-of-kernel-memory-at-boot-time.patch
> ppc-and-powerpc-specify-amount-of-kernel-memory-at-boot-time.patch
> x86_64-specify-amount-of-kernel-memory-at-boot-time.patch
> x86-specify-amount-of-kernel-memory-at-boot-time.patch
>
hm, OK. That makes a bit of a mess of the patch series but we can live
with that.
>
> Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>
> Acked-by: Mel Gorman <mel@csn.ul.ie>
> Acked-by: Andy Whitcroft <apw@shadowen.org>
Patch protocol: Yasunori Gogo wrote the patch, so there should have been a
From:him at the very top of the changelog. And you were in the patch
delivery path so you should have used Signed-off-by: rather than Acked-by:.
I made those two changes.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] Align ZONE_MOVABLE to a MAX_ORDER_NR_PAGES boundary
2007-04-24 18:01 ` [PATCH 2/2] Align ZONE_MOVABLE to a MAX_ORDER_NR_PAGES boundary Mel Gorman
@ 2007-04-25 2:00 ` Yasunori Goto
0 siblings, 0 replies; 5+ messages in thread
From: Yasunori Goto @ 2007-04-25 2:00 UTC (permalink / raw)
To: Mel Gorman; +Cc: akpm, linux-kernel, linux-mm, apw, kamezawa.hiroyu
Looks good. :-)
Thanks.
Acked-by: Yasunori Goto <y-goto@jp.fujitsu.com>
>
> The boot memory allocator makes assumptions on the alignment of zone
> boundaries even though the buddy allocator has no requirements on the
> alignment of zones. This may cause boot problems in situations where
> ZONE_MOVABLE is populated because the bootmem allocator assumes zones are
> at least order-log2(BITS_PER_LONG) aligned. As the two potential users
> (huge pages and memory hot-remove) of ZONE_MOVABLE would prefer a higher
> alignment, this patch aligns the start of the zone instead of fixing the
> different assumptions made by the bootmem allocator.
>
> This patch rounds the start of ZONE_MOVABLE in each node to a
> MAX_ORDER_NR_PAGES boundary. If the rounding pushes the start of ZONE_MOVABLE
> above the end of the node then the zone will contain no memory and will not
> be used at runtime. The value is rounded up instead of down as it is
> better to have the kernel-portion of memory larger than requested instead
> of smaller. The impact is that the kernel-usable portion of memory because a
> minimum guarantee instead of the exact size requested by the user.
>
>
> Signed-off-by: Mel Gorman <mel@csn.ul.ie>
> Acked-by: Andy Whitcroft <apw@shadowen.org>
> ---
>
> page_alloc.c | 5 +++++
> 1 files changed, 5 insertions(+)
>
> diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc6-mm1-002_commonparse/mm/page_alloc.c linux-2.6.21-rc6-mm1-003_alignmovable/mm/page_alloc.c
> --- linux-2.6.21-rc6-mm1-002_commonparse/mm/page_alloc.c 2007-04-24 09:38:30.000000000 +0100
> +++ linux-2.6.21-rc6-mm1-003_alignmovable/mm/page_alloc.c 2007-04-24 11:15:40.000000000 +0100
> @@ -3642,6 +3642,11 @@ restart:
> usable_nodes--;
> if (usable_nodes && required_kernelcore > usable_nodes)
> goto restart;
> +
> + /* Align start of ZONE_MOVABLE on all nids to MAX_ORDER_NR_PAGES */
> + for (nid = 0; nid < MAX_NUMNODES; nid++)
> + zone_movable_pfn[nid] =
> + roundup(zone_movable_pfn[nid], MAX_ORDER_NR_PAGES);
> }
>
> /**
--
Yasunori Goto
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-04-25 2:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-24 18:00 [PATCH 0/2] Fix two boot problems related to ZONE_MOVABLE sizing Mel Gorman
2007-04-24 18:00 ` [PATCH 1/2] Handle kernelcore= boot parameter in common code to avoid boot problem on IA64 Mel Gorman
2007-04-24 21:04 ` Andrew Morton
2007-04-24 18:01 ` [PATCH 2/2] Align ZONE_MOVABLE to a MAX_ORDER_NR_PAGES boundary Mel Gorman
2007-04-25 2:00 ` Yasunori Goto
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox