Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 145787
b: refs/heads/master
c: 7c43769
h: refs/heads/master
i:
  145785: ac666d1
  145783: 917f7da
v: v3
  • Loading branch information
Yinghai Lu authored and Ingo Molnar committed May 18, 2009
1 parent 3d893ed commit 9bcb093
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 31 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 888a589f6be07d624e21e2174d98375e9f95911b
refs/heads/master: 7c43769a9776141ec23ca81a1bdd5a9c0512f165
7 changes: 7 additions & 0 deletions trunk/arch/x86/include/asm/numa_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ extern void setup_node_bootmem(int nodeid, unsigned long start,
unsigned long end);

#ifdef CONFIG_NUMA
/*
* Too small node sizes may confuse the VM badly. Usually they
* result from BIOS bugs. So dont recognize nodes as standalone
* NUMA entities that have less than this amount of RAM listed:
*/
#define NODE_MIN_SIZE (4*1024*1024)

extern void __init init_cpu_to_node(void);
extern void __cpuinit numa_set_node(int cpu, int node);
extern void __cpuinit numa_clear_node(int cpu);
Expand Down
13 changes: 10 additions & 3 deletions trunk/arch/x86/mm/numa_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,18 +179,25 @@ static void * __init early_node_mem(int nodeid, unsigned long start,
}

/* Initialize bootmem allocator for a node */
void __init setup_node_bootmem(int nodeid, unsigned long start,
unsigned long end)
void __init
setup_node_bootmem(int nodeid, unsigned long start, unsigned long end)
{
unsigned long start_pfn, last_pfn, bootmap_pages, bootmap_size;
const int pgdat_size = roundup(sizeof(pg_data_t), PAGE_SIZE);
unsigned long bootmap_start, nodedata_phys;
void *bootmap;
const int pgdat_size = roundup(sizeof(pg_data_t), PAGE_SIZE);
int nid;

if (!end)
return;

/*
* Don't confuse VM with a node that doesn't have the
* minimum amount of memory:
*/
if (end && (end - start) < NODE_MIN_SIZE)
return;

start = roundup(start, ZONE_ALIGN);

printk(KERN_INFO "Bootmem setup node %d %016lx-%016lx\n", nodeid,
Expand Down
29 changes: 2 additions & 27 deletions trunk/arch/x86/mm/srat_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ static int num_node_memblks __initdata;
static struct bootnode node_memblk_range[NR_NODE_MEMBLKS] __initdata;
static int memblk_nodeid[NR_NODE_MEMBLKS] __initdata;

/* Too small nodes confuse the VM badly. Usually they result
from BIOS bugs. */
#define NODE_MIN_SIZE (4*1024*1024)

static __init int setup_node(int pxm)
{
return acpi_map_pxm_to_node(pxm);
Expand Down Expand Up @@ -338,17 +334,6 @@ static int __init nodes_cover_memory(const struct bootnode *nodes)
return 1;
}

static void __init unparse_node(int node)
{
int i;
node_clear(node, nodes_parsed);
node_clear(node, cpu_nodes_parsed);
for (i = 0; i < MAX_LOCAL_APIC; i++) {
if (apicid_to_node[i] == node)
apicid_to_node[i] = NUMA_NO_NODE;
}
}

void __init acpi_numa_arch_fixup(void) {}

/* Use the information discovered above to actually set up the nodes. */
Expand All @@ -360,18 +345,8 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end)
return -1;

/* First clean up the node list */
for (i = 0; i < MAX_NUMNODES; i++) {
for (i = 0; i < MAX_NUMNODES; i++)
cutoff_node(i, start, end);
/*
* don't confuse VM with a node that doesn't have the
* minimum memory.
*/
if (nodes[i].end &&
(nodes[i].end - nodes[i].start) < NODE_MIN_SIZE) {
unparse_node(i);
node_set_offline(i);
}
}

if (!nodes_cover_memory(nodes)) {
bad_srat();
Expand Down Expand Up @@ -404,7 +379,7 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end)

if (node == NUMA_NO_NODE)
continue;
if (!node_isset(node, node_possible_map))
if (!node_online(node))
numa_clear_node(i);
}
numa_init_array();
Expand Down

0 comments on commit 9bcb093

Please sign in to comment.