Commit 1e37e89c authored by Martin J. Bligh's avatar Martin J. Bligh Committed by Linus Torvalds

[PATCH] 2/6 Make CONFIG_NUMA work on non-numa machines.

From Andy Whitcroft

A few very simple changes in order to make CONFIG_NUMA work everywhere, so
the distros can build one common binary kernel for distributions.
parent 82d82900
......@@ -488,7 +488,7 @@ config NR_CPUS
# Common NUMA Features
config NUMA
bool "Numa Memory Allocation Support"
depends on (HIGHMEM64G && (X86_NUMAQ || (X86_SUMMIT && ACPI && !ACPI_HT_ONLY)))
depends on (HIGHMEM64G && (X86_NUMAQ || (X86_SUMMIT && ACPI && !ACPI_HT_ONLY))) || X86_PC
config DISCONTIGMEM
bool
......
......@@ -966,6 +966,7 @@ static void __init smp_boot_cpus(unsigned int max_cpus)
if (APIC_init_uniprocessor())
printk(KERN_NOTICE "Local APIC not detected."
" Using dummy APIC emulation.\n");
map_cpu_to_logical_apicid();
return;
}
......
......@@ -81,6 +81,36 @@ unsigned long node_remap_offset[MAX_NUMNODES];
void *node_remap_start_vaddr[MAX_NUMNODES];
void set_pmd_pfn(unsigned long vaddr, unsigned long pfn, pgprot_t flags);
/*
* FLAT - support for basic PC memory model with discontig enabled, essentially
* a single node with all available processors in it with a flat
* memory map.
*/
void __init get_memcfg_numa_flat(void)
{
int pfn;
printk("NUMA - single node, flat memory mode\n");
/* Run the memory configuration and find the top of memory. */
find_max_pfn();
node_start_pfn[0] = 0;
node_end_pfn[0] = max_pfn;
/* Fill in the physnode_map with our simplistic memory model,
* all memory is in node 0.
*/
for (pfn = node_start_pfn[0]; pfn <= node_end_pfn[0];
pfn += PAGES_PER_ELEMENT)
{
physnode_map[pfn / PAGES_PER_ELEMENT] = 0;
}
/* Indicate there is one node available. */
node_set_online(0);
numnodes = 1;
}
/*
* Find the highest page frame number we have available for the node
*/
......
......@@ -122,6 +122,9 @@ static inline struct pglist_data *pfn_to_pgdat(unsigned long pfn)
#include <asm/numaq.h>
#elif CONFIG_X86_SUMMIT
#include <asm/srat.h>
#elif CONFIG_X86_PC
#define get_memcfg_numa get_memcfg_numa_flat
#define get_zholes_size(n) (0)
#else
#define pfn_to_nid(pfn) (0)
#endif /* CONFIG_X86_NUMAQ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment