Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2b97690f authored by Matt Tolentino's avatar Matt Tolentino Committed by Linus Torvalds
Browse files

[PATCH] reorganize x86-64 NUMA and DISCONTIGMEM config options



In order to use the alternative sparsemem implmentation for NUMA kernels,
we need to reorganize the config options.  This patch effectively abstracts
out the CONFIG_DISCONTIGMEM options to CONFIG_NUMA in most cases.  Thus,
the discontigmem implementation may be employed as always, but the
sparsemem implementation may be used alternatively.

Signed-off-by: default avatarMatt Tolentino <matthew.e.tolentino@intel.com>
Signed-off-by: default avatarDave Hansen <haveblue@us.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 1035faf1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -94,7 +94,7 @@ void __init x86_64_start_kernel(char * real_mode_data)
	s = strstr(saved_command_line, "earlyprintk=");
	if (s != NULL)
		setup_early_printk(s);
#ifdef CONFIG_DISCONTIGMEM
#ifdef CONFIG_NUMA
	s = strstr(saved_command_line, "numa=");
	if (s != NULL)
		numa_setup(s+5);
+3 −3
Original line number Diff line number Diff line
@@ -348,7 +348,7 @@ static __init void parse_cmdline_early (char ** cmdline_p)
		if (!memcmp(from, "mem=", 4))
			parse_memopt(from+4, &from); 

#ifdef CONFIG_DISCONTIGMEM
#ifdef CONFIG_NUMA
		if (!memcmp(from, "numa=", 5))
			numa_setup(from+5); 
#endif
@@ -377,7 +377,7 @@ static __init void parse_cmdline_early (char ** cmdline_p)
	*cmdline_p = command_line;
}

#ifndef CONFIG_DISCONTIGMEM
#ifndef CONFIG_NUMA
static void __init contig_initmem_init(void)
{
        unsigned long bootmap_size, bootmap; 
@@ -554,7 +554,7 @@ void __init setup_arch(char **cmdline_p)
	acpi_numa_init();
#endif

#ifdef CONFIG_DISCONTIGMEM
#ifdef CONFIG_NUMA
	numa_initmem_init(0, end_pfn); 
#else
	contig_initmem_init(); 
+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@

obj-y	 := init.o fault.o ioremap.o extable.o pageattr.o
obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
obj-$(CONFIG_DISCONTIGMEM) += numa.o
obj-$(CONFIG_NUMA) += numa.o
obj-$(CONFIG_K8_NUMA) += k8topology.o
obj-$(CONFIG_ACPI_NUMA) += srat.o

+6 −3
Original line number Diff line number Diff line
@@ -318,7 +318,7 @@ void zap_low_mappings(void)
	flush_tlb_all();
}

#ifndef CONFIG_DISCONTIGMEM
#ifndef CONFIG_NUMA
void __init paging_init(void)
{
	{
@@ -427,13 +427,16 @@ void __init mem_init(void)
	reservedpages = 0;

	/* this will put all low memory onto the freelists */
#ifdef CONFIG_DISCONTIGMEM
#ifdef CONFIG_NUMA
	totalram_pages += numa_free_all_bootmem();
	tmp = 0;
	/* should count reserved pages here for all nodes */ 
#else

#ifdef CONFIG_FLATMEM
	max_mapnr = end_pfn;
	if (!mem_map) BUG();
#endif

	totalram_pages += free_all_bootmem();

@@ -515,7 +518,7 @@ void free_initrd_mem(unsigned long start, unsigned long end)
void __init reserve_bootmem_generic(unsigned long phys, unsigned len) 
{ 
	/* Should check here against the e820 map to avoid double free */ 
#ifdef CONFIG_DISCONTIGMEM
#ifdef CONFIG_NUMA
	int nid = phys_to_nid(phys);
  	reserve_bootmem_node(NODE_DATA(nid), phys, len);
#else       		
+1 −1
Original line number Diff line number Diff line
@@ -178,7 +178,7 @@ void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned l
	if (phys_addr >= ISA_START_ADDRESS && last_addr < ISA_END_ADDRESS)
		return (__force void __iomem *)phys_to_virt(phys_addr);

#ifndef CONFIG_DISCONTIGMEM
#ifdef CONFIG_FLATMEM
	/*
	 * Don't allow anybody to remap normal RAM that we're using..
	 */
Loading