From: Yinghai Lu <yhlu.kernel@gmail.com>
To: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
"H. Peter Anvin" <hpa@zytor.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] x86: merge zones_sizes_init for numa and non numa on 32bit
Date: Wed, 2 Jul 2008 00:31:02 -0700 [thread overview]
Message-ID: <200807020031.02945.yhlu.kernel@gmail.com> (raw)
In-Reply-To: <200806301834.59156.yhlu.kernel@gmail.com>
move out e820_register_active_regions from non numa zones_sizes_init()
and remove numa version zones_sizes_init().
and let 32 bit call remove_all_active_ranges in setup_arch directly like 64 bit
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
---
arch/x86/kernel/setup.c | 2 --
arch/x86/mm/discontig_32.c | 16 ----------------
arch/x86/mm/init_32.c | 10 ++++------
include/asm-x86/page_32.h | 1 -
4 files changed, 4 insertions(+), 25 deletions(-)
Index: linux-2.6/arch/x86/kernel/setup.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/setup.c
+++ linux-2.6/arch/x86/kernel/setup.c
@@ -719,10 +719,8 @@ void __init setup_arch(char **cmdline_p)
*/
acpi_boot_table_init();
-#ifdef CONFIG_X86_64
/* Remove active ranges so rediscovery with NUMA-awareness happens */
remove_all_active_ranges();
-#endif
#ifdef CONFIG_ACPI_NUMA
/*
Index: linux-2.6/arch/x86/mm/discontig_32.c
===================================================================
--- linux-2.6.orig/arch/x86/mm/discontig_32.c
+++ linux-2.6/arch/x86/mm/discontig_32.c
@@ -327,7 +327,6 @@ void __init initmem_init(unsigned long s
* and ZONE_HIGHMEM.
*/
- remove_all_active_ranges();
get_memcfg_numa();
kva_pages = round_up(calculate_numa_remap_pages(), PTRS_PER_PTE);
@@ -390,21 +389,6 @@ void __init initmem_init(unsigned long s
setup_bootmem_allocator();
}
-void __init zone_sizes_init(void)
-{
- unsigned long max_zone_pfns[MAX_NR_ZONES];
- memset(max_zone_pfns, 0, sizeof(max_zone_pfns));
- max_zone_pfns[ZONE_DMA] =
- virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT;
- max_zone_pfns[ZONE_NORMAL] = max_low_pfn;
-#ifdef CONFIG_HIGHMEM
- max_zone_pfns[ZONE_HIGHMEM] = highend_pfn;
-#endif
-
- free_area_init_nodes(max_zone_pfns);
- return;
-}
-
void __init set_highmem_pages_init(void)
{
#ifdef CONFIG_HIGHMEM
Index: linux-2.6/arch/x86/mm/init_32.c
===================================================================
--- linux-2.6.orig/arch/x86/mm/init_32.c
+++ linux-2.6/arch/x86/mm/init_32.c
@@ -660,12 +660,14 @@ void __init initmem_init(unsigned long s
if (max_pfn > max_low_pfn)
highstart_pfn = max_low_pfn;
memory_present(0, 0, highend_pfn);
+ e820_register_active_regions(0, 0, highend_pfn);
printk(KERN_NOTICE "%ldMB HIGHMEM available.\n",
pages_to_mb(highend_pfn - highstart_pfn));
num_physpages = highend_pfn;
high_memory = (void *) __va(highstart_pfn * PAGE_SIZE - 1) + 1;
#else
memory_present(0, 0, max_low_pfn);
+ e820_register_active_regions(0, 0, max_low_pfn);
num_physpages = max_low_pfn;
high_memory = (void *) __va(max_low_pfn * PAGE_SIZE - 1) + 1;
#endif
@@ -677,25 +679,21 @@ void __init initmem_init(unsigned long s
setup_bootmem_allocator();
}
+#endif /* !CONFIG_NEED_MULTIPLE_NODES */
-void __init zone_sizes_init(void)
+static void __init zone_sizes_init(void)
{
unsigned long max_zone_pfns[MAX_NR_ZONES];
memset(max_zone_pfns, 0, sizeof(max_zone_pfns));
max_zone_pfns[ZONE_DMA] =
virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT;
max_zone_pfns[ZONE_NORMAL] = max_low_pfn;
- remove_all_active_ranges();
#ifdef CONFIG_HIGHMEM
max_zone_pfns[ZONE_HIGHMEM] = highend_pfn;
- e820_register_active_regions(0, 0, highend_pfn);
-#else
- e820_register_active_regions(0, 0, max_low_pfn);
#endif
free_area_init_nodes(max_zone_pfns);
}
-#endif /* !CONFIG_NEED_MULTIPLE_NODES */
void __init setup_bootmem_allocator(void)
{
Index: linux-2.6/include/asm-x86/page_32.h
===================================================================
--- linux-2.6.orig/include/asm-x86/page_32.h
+++ linux-2.6/include/asm-x86/page_32.h
@@ -101,7 +101,6 @@ extern void find_low_pfn_range(void);
extern unsigned long init_memory_mapping(unsigned long start,
unsigned long end);
extern void initmem_init(unsigned long, unsigned long);
-extern void zone_sizes_init(void);
extern void setup_bootmem_allocator(void);
next prev parent reply other threads:[~2008-07-02 7:29 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-01 1:34 [PATCH] x86: don't reallocate pgt for node0 Yinghai Lu
2008-07-01 8:44 ` Ingo Molnar
2008-07-02 3:02 ` [PATCH] x86: change copy_e820_map to append_e820_map Yinghai Lu
2008-07-03 13:58 ` Ingo Molnar
2008-07-02 3:03 ` [PATCH] x86: make early_res_to_bootmem print out less 80 width chars Yinghai Lu
2008-07-03 13:58 ` Ingo Molnar
2008-07-02 3:04 ` [PATCH] x86: not printout if not finding setup_data Yinghai Lu
2008-07-03 13:55 ` Ingo Molnar
2008-07-02 7:31 ` Yinghai Lu [this message]
2008-07-03 13:54 ` [PATCH] x86: merge zones_sizes_init for numa and non numa on 32bit Ingo Molnar
2008-07-03 1:53 ` [PATCH] x86: move init_cpu_to_node after get_smp_config Yinghai Lu
2008-07-03 13:54 ` Ingo Molnar
[not found] ` <200807021851.02301.yinghai.lu@sun.com>
2008-07-03 1:54 ` [PATCH] x86: move prefill_possible_map calling early Yinghai Lu
2008-07-03 13:54 ` Ingo Molnar
2008-07-03 14:03 ` Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200807020031.02945.yhlu.kernel@gmail.com \
--to=yhlu.kernel@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox