Commit b9462e80 authored by Matthew Dobson's avatar Matthew Dobson Committed by Linus Torvalds

[PATCH] Replace 'numnodes' with 'node_online_map' - arm

Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 0c33aaa4
......@@ -55,7 +55,7 @@ void show_mem(void)
show_free_areas();
printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
for (node = 0; node < numnodes; node++) {
for_each_online_node(node) {
struct page *page, *end;
page = NODE_MEM_MAP(node);
......@@ -178,18 +178,14 @@ find_memend_and_nodes(struct meminfo *mi, struct node_info *np)
node = mi->bank[i].node;
if (node >= numnodes) {
numnodes = node + 1;
/*
* Make sure we haven't exceeded the maximum number
* of nodes that we have in this configuration. If
* we have, we're in trouble. (maybe we ought to
* limit, instead of bugging?)
*/
if (numnodes > MAX_NUMNODES)
BUG();
}
/*
* Make sure we haven't exceeded the maximum number of nodes
* that we have in this configuration. If we have, we're in
* trouble. (maybe we ought to limit, instead of bugging?)
*/
if (node >= MAX_NUMNODES)
BUG();
node_set_online(node);
/*
* Get the start and end pfns for this bank
......@@ -211,7 +207,7 @@ find_memend_and_nodes(struct meminfo *mi, struct node_info *np)
* Calculate the number of pages we require to
* store the bootmem bitmaps.
*/
for (i = 0; i < numnodes; i++) {
for_each_online_node(i) {
if (np[i].end == 0)
continue;
......@@ -380,13 +376,13 @@ static void __init bootmem_init(struct meminfo *mi)
* (we could also do with rolling bootmem_init and paging_init
* into one generic "memory_init" type function).
*/
np += numnodes - 1;
for (node = numnodes - 1; node >= 0; node--, np--) {
np += num_online_nodes() - 1;
for (node = num_online_nodes() - 1; node >= 0; node--, np--) {
/*
* If there are no pages in this node, ignore it.
* Note that node 0 must always have some pages.
*/
if (np->end == 0) {
if (np->end == 0 || !node_online(node)) {
if (node == 0)
BUG();
continue;
......@@ -449,7 +445,7 @@ void __init paging_init(struct meminfo *mi, struct machine_desc *mdesc)
/*
* initialise the zones within each node
*/
for (node = 0; node < numnodes; node++) {
for_each_online_node(node) {
unsigned long zone_size[MAX_NR_ZONES];
unsigned long zhole_size[MAX_NR_ZONES];
struct bootmem_data *bdata;
......@@ -558,7 +554,7 @@ void __init mem_init(void)
create_memmap_holes(&meminfo);
/* this will put all unused low memory onto the freelists */
for (node = 0; node < numnodes; node++) {
for_each_online_node(node) {
pg_data_t *pgdat = NODE_DATA(node);
if (pgdat->node_spanned_pages != 0)
......
......@@ -701,6 +701,6 @@ void __init create_memmap_holes(struct meminfo *mi)
{
int node;
for (node = 0; node < numnodes; node++)
for_each_online_node(node)
free_unused_memmap_node(node, mi);
}
......@@ -155,7 +155,8 @@ find_memend_and_nodes(struct meminfo *mi, struct node_info *np)
{
unsigned int memend_pfn = 0;
numnodes = 1;
nodes_clear(node_online_map);
node_set_online(0);
np->bootmap_pages = 0;
......
......@@ -37,8 +37,6 @@
* node 3: 0xac000000-0xafffffff --> 0xcc000000-0xcfffffff
*/
#define NR_NODES 4
/*
* Given a kernel address, find the home node of the underlying memory.
*/
......
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