diff options
author | Xishi Qiu <qiuxishi@huawei.com> | 2014-12-09 21:09:01 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-12-11 05:35:02 -0500 |
commit | c072b90c8dfe135072f646cc50b826e30c5aa558 (patch) | |
tree | 2cf0e007f98b23575396dfb6fb3313bd47361de8 | |
parent | 96ed4cd0aa86ac1a753baeef26c911a9449493e9 (diff) |
x86/mm: Fix zone ranges boot printout
This is the usual physical memory layout boot printout:
...
[ 0.000000] Zone ranges:
[ 0.000000] DMA [mem 0x00001000-0x00ffffff]
[ 0.000000] DMA32 [mem 0x01000000-0xffffffff]
[ 0.000000] Normal [mem 0x100000000-0xc3fffffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x00001000-0x00099fff]
[ 0.000000] node 0: [mem 0x00100000-0xbf78ffff]
[ 0.000000] node 0: [mem 0x100000000-0x63fffffff]
[ 0.000000] node 1: [mem 0x640000000-0xc3fffffff]
...
This is the log when we set "mem=2G" on the boot cmdline:
...
[ 0.000000] Zone ranges:
[ 0.000000] DMA [mem 0x00001000-0x00ffffff]
[ 0.000000] DMA32 [mem 0x01000000-0xffffffff] // should be 0x7fffffff, right?
[ 0.000000] Normal empty
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x00001000-0x00099fff]
[ 0.000000] node 0: [mem 0x00100000-0x7fffffff]
...
This patch fixes the printout, the following log shows the right
ranges:
...
[ 0.000000] Zone ranges:
[ 0.000000] DMA [mem 0x00001000-0x00ffffff]
[ 0.000000] DMA32 [mem 0x01000000-0x7fffffff]
[ 0.000000] Normal empty
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x00001000-0x00099fff]
[ 0.000000] node 0: [mem 0x00100000-0x7fffffff]
...
Suggested-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Xishi Qiu <qiuxishi@huawei.com>
Cc: Linux MM <linux-mm@kvack.org>
Cc: <dave@sr71.net>
Cc: Rik van Riel <riel@redhat.com>
Link: http://lkml.kernel.org/r/5487AB3D.6070306@huawei.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | arch/x86/include/asm/dma.h | 2 | ||||
-rw-r--r-- | arch/x86/mm/init.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/include/asm/dma.h b/arch/x86/include/asm/dma.h index 0bdb0c54d9a1..fe884e18fa6e 100644 --- a/arch/x86/include/asm/dma.h +++ b/arch/x86/include/asm/dma.h | |||
@@ -70,7 +70,7 @@ | |||
70 | #define MAX_DMA_CHANNELS 8 | 70 | #define MAX_DMA_CHANNELS 8 |
71 | 71 | ||
72 | /* 16MB ISA DMA zone */ | 72 | /* 16MB ISA DMA zone */ |
73 | #define MAX_DMA_PFN ((16 * 1024 * 1024) >> PAGE_SHIFT) | 73 | #define MAX_DMA_PFN ((16UL * 1024 * 1024) >> PAGE_SHIFT) |
74 | 74 | ||
75 | /* 4GB broken PCI/AGP hardware bus master zone */ | 75 | /* 4GB broken PCI/AGP hardware bus master zone */ |
76 | #define MAX_DMA32_PFN ((4UL * 1024 * 1024 * 1024) >> PAGE_SHIFT) | 76 | #define MAX_DMA32_PFN ((4UL * 1024 * 1024 * 1024) >> PAGE_SHIFT) |
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c index 66dba36f2343..07244aa6609e 100644 --- a/arch/x86/mm/init.c +++ b/arch/x86/mm/init.c | |||
@@ -674,10 +674,10 @@ void __init zone_sizes_init(void) | |||
674 | memset(max_zone_pfns, 0, sizeof(max_zone_pfns)); | 674 | memset(max_zone_pfns, 0, sizeof(max_zone_pfns)); |
675 | 675 | ||
676 | #ifdef CONFIG_ZONE_DMA | 676 | #ifdef CONFIG_ZONE_DMA |
677 | max_zone_pfns[ZONE_DMA] = MAX_DMA_PFN; | 677 | max_zone_pfns[ZONE_DMA] = min(MAX_DMA_PFN, max_low_pfn); |
678 | #endif | 678 | #endif |
679 | #ifdef CONFIG_ZONE_DMA32 | 679 | #ifdef CONFIG_ZONE_DMA32 |
680 | max_zone_pfns[ZONE_DMA32] = MAX_DMA32_PFN; | 680 | max_zone_pfns[ZONE_DMA32] = min(MAX_DMA32_PFN, max_low_pfn); |
681 | #endif | 681 | #endif |
682 | max_zone_pfns[ZONE_NORMAL] = max_low_pfn; | 682 | max_zone_pfns[ZONE_NORMAL] = max_low_pfn; |
683 | #ifdef CONFIG_HIGHMEM | 683 | #ifdef CONFIG_HIGHMEM |