diff options
author | Johannes Weiner <hannes@saeurebad.de> | 2008-07-24 00:27:20 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-24 13:47:16 -0400 |
commit | 9109fb7b3520de187ebc3646c209d66a233f7169 (patch) | |
tree | f1d64d2efafb8e1652836126523f1b36fb10acd1 | |
parent | 2185e69f680ae8c8496b6fc15e20c889d5b39b67 (diff) |
mm: drop unneeded pgdat argument from free_area_init_node()
free_area_init_node() gets passed in the node id as well as the node
descriptor. This is redundant as the function can trivially get the node
descriptor itself by means of NODE_DATA() and the node's id.
I checked all the users and NODE_DATA() seems to be usable everywhere
from where this function is called.
Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | arch/alpha/mm/numa.c | 2 | ||||
-rw-r--r-- | arch/arm/mm/init.c | 2 | ||||
-rw-r--r-- | arch/avr32/mm/init.c | 2 | ||||
-rw-r--r-- | arch/cris/arch-v10/mm/init.c | 2 | ||||
-rw-r--r-- | arch/cris/arch-v32/mm/init.c | 2 | ||||
-rw-r--r-- | arch/m32r/mm/discontig.c | 3 | ||||
-rw-r--r-- | arch/m32r/mm/init.c | 2 | ||||
-rw-r--r-- | arch/m68k/mm/motorola.c | 2 | ||||
-rw-r--r-- | arch/m68k/mm/sun3mmu.c | 2 | ||||
-rw-r--r-- | arch/parisc/mm/init.c | 2 | ||||
-rw-r--r-- | arch/sparc/mm/srmmu.c | 3 | ||||
-rw-r--r-- | arch/sparc/mm/sun4c.c | 3 | ||||
-rw-r--r-- | arch/v850/kernel/setup.c | 3 | ||||
-rw-r--r-- | include/linux/mm.h | 5 | ||||
-rw-r--r-- | mm/memory_hotplug.c | 2 | ||||
-rw-r--r-- | mm/page_alloc.c | 11 |
16 files changed, 22 insertions, 26 deletions
diff --git a/arch/alpha/mm/numa.c b/arch/alpha/mm/numa.c index a53fda0481ca..def0c74a78a8 100644 --- a/arch/alpha/mm/numa.c +++ b/arch/alpha/mm/numa.c | |||
@@ -313,7 +313,7 @@ void __init paging_init(void) | |||
313 | zones_size[ZONE_DMA] = dma_local_pfn; | 313 | zones_size[ZONE_DMA] = dma_local_pfn; |
314 | zones_size[ZONE_NORMAL] = (end_pfn - start_pfn) - dma_local_pfn; | 314 | zones_size[ZONE_NORMAL] = (end_pfn - start_pfn) - dma_local_pfn; |
315 | } | 315 | } |
316 | free_area_init_node(nid, NODE_DATA(nid), zones_size, start_pfn, NULL); | 316 | free_area_init_node(nid, zones_size, start_pfn, NULL); |
317 | } | 317 | } |
318 | 318 | ||
319 | /* Initialize the kernel's ZERO_PGE. */ | 319 | /* Initialize the kernel's ZERO_PGE. */ |
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index b657f1719af0..e6352946dde0 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c | |||
@@ -284,7 +284,7 @@ bootmem_init_node(int node, int initrd_node, struct meminfo *mi) | |||
284 | */ | 284 | */ |
285 | arch_adjust_zones(node, zone_size, zhole_size); | 285 | arch_adjust_zones(node, zone_size, zhole_size); |
286 | 286 | ||
287 | free_area_init_node(node, pgdat, zone_size, start_pfn, zhole_size); | 287 | free_area_init_node(node, zone_size, start_pfn, zhole_size); |
288 | 288 | ||
289 | return end_pfn; | 289 | return end_pfn; |
290 | } | 290 | } |
diff --git a/arch/avr32/mm/init.c b/arch/avr32/mm/init.c index 3f90a87527bb..786de88a82a7 100644 --- a/arch/avr32/mm/init.c +++ b/arch/avr32/mm/init.c | |||
@@ -129,7 +129,7 @@ void __init paging_init(void) | |||
129 | printk("Node %u: start_pfn = 0x%lx, low = 0x%lx\n", | 129 | printk("Node %u: start_pfn = 0x%lx, low = 0x%lx\n", |
130 | nid, start_pfn, low); | 130 | nid, start_pfn, low); |
131 | 131 | ||
132 | free_area_init_node(nid, pgdat, zones_size, start_pfn, NULL); | 132 | free_area_init_node(nid, zones_size, start_pfn, NULL); |
133 | 133 | ||
134 | printk("Node %u: mem_map starts at %p\n", | 134 | printk("Node %u: mem_map starts at %p\n", |
135 | pgdat->node_id, pgdat->node_mem_map); | 135 | pgdat->node_id, pgdat->node_mem_map); |
diff --git a/arch/cris/arch-v10/mm/init.c b/arch/cris/arch-v10/mm/init.c index e0fcd1a9bfd5..742fd1974c2e 100644 --- a/arch/cris/arch-v10/mm/init.c +++ b/arch/cris/arch-v10/mm/init.c | |||
@@ -182,7 +182,7 @@ paging_init(void) | |||
182 | * mem_map page array. | 182 | * mem_map page array. |
183 | */ | 183 | */ |
184 | 184 | ||
185 | free_area_init_node(0, &contig_page_data, zones_size, PAGE_OFFSET >> PAGE_SHIFT, 0); | 185 | free_area_init_node(0, zones_size, PAGE_OFFSET >> PAGE_SHIFT, 0); |
186 | } | 186 | } |
187 | 187 | ||
188 | /* Initialize remaps of some I/O-ports. It is important that this | 188 | /* Initialize remaps of some I/O-ports. It is important that this |
diff --git a/arch/cris/arch-v32/mm/init.c b/arch/cris/arch-v32/mm/init.c index 5a9ac5834647..8a34b8b74293 100644 --- a/arch/cris/arch-v32/mm/init.c +++ b/arch/cris/arch-v32/mm/init.c | |||
@@ -162,7 +162,7 @@ paging_init(void) | |||
162 | * substantially higher than 0, like us (we start at PAGE_OFFSET). This | 162 | * substantially higher than 0, like us (we start at PAGE_OFFSET). This |
163 | * saves space in the mem_map page array. | 163 | * saves space in the mem_map page array. |
164 | */ | 164 | */ |
165 | free_area_init_node(0, &contig_page_data, zones_size, PAGE_OFFSET >> PAGE_SHIFT, 0); | 165 | free_area_init_node(0, zones_size, PAGE_OFFSET >> PAGE_SHIFT, 0); |
166 | 166 | ||
167 | mem_map = contig_page_data.node_mem_map; | 167 | mem_map = contig_page_data.node_mem_map; |
168 | } | 168 | } |
diff --git a/arch/m32r/mm/discontig.c b/arch/m32r/mm/discontig.c index aa9145ef6cca..cc23934bc41e 100644 --- a/arch/m32r/mm/discontig.c +++ b/arch/m32r/mm/discontig.c | |||
@@ -147,8 +147,7 @@ unsigned long __init zone_sizes_init(void) | |||
147 | zholes_size[ZONE_DMA] = mp->holes; | 147 | zholes_size[ZONE_DMA] = mp->holes; |
148 | holes += zholes_size[ZONE_DMA]; | 148 | holes += zholes_size[ZONE_DMA]; |
149 | 149 | ||
150 | free_area_init_node(nid, NODE_DATA(nid), zones_size, | 150 | free_area_init_node(nid, zones_size, start_pfn, zholes_size); |
151 | start_pfn, zholes_size); | ||
152 | } | 151 | } |
153 | 152 | ||
154 | /* | 153 | /* |
diff --git a/arch/m32r/mm/init.c b/arch/m32r/mm/init.c index bbd97c85bc5d..28799af15e95 100644 --- a/arch/m32r/mm/init.c +++ b/arch/m32r/mm/init.c | |||
@@ -123,7 +123,7 @@ unsigned long __init zone_sizes_init(void) | |||
123 | start_pfn = __MEMORY_START >> PAGE_SHIFT; | 123 | start_pfn = __MEMORY_START >> PAGE_SHIFT; |
124 | #endif /* CONFIG_MMU */ | 124 | #endif /* CONFIG_MMU */ |
125 | 125 | ||
126 | free_area_init_node(0, NODE_DATA(0), zones_size, start_pfn, 0); | 126 | free_area_init_node(0, zones_size, start_pfn, 0); |
127 | 127 | ||
128 | return 0; | 128 | return 0; |
129 | } | 129 | } |
diff --git a/arch/m68k/mm/motorola.c b/arch/m68k/mm/motorola.c index 226795bdf355..c5dbb9bdb322 100644 --- a/arch/m68k/mm/motorola.c +++ b/arch/m68k/mm/motorola.c | |||
@@ -296,7 +296,7 @@ void __init paging_init(void) | |||
296 | #endif | 296 | #endif |
297 | for (i = 0; i < m68k_num_memory; i++) { | 297 | for (i = 0; i < m68k_num_memory; i++) { |
298 | zones_size[ZONE_DMA] = m68k_memory[i].size >> PAGE_SHIFT; | 298 | zones_size[ZONE_DMA] = m68k_memory[i].size >> PAGE_SHIFT; |
299 | free_area_init_node(i, pg_data_map + i, zones_size, | 299 | free_area_init_node(i, zones_size, |
300 | m68k_memory[i].addr >> PAGE_SHIFT, NULL); | 300 | m68k_memory[i].addr >> PAGE_SHIFT, NULL); |
301 | } | 301 | } |
302 | } | 302 | } |
diff --git a/arch/m68k/mm/sun3mmu.c b/arch/m68k/mm/sun3mmu.c index edceefc18870..1b902dbd4376 100644 --- a/arch/m68k/mm/sun3mmu.c +++ b/arch/m68k/mm/sun3mmu.c | |||
@@ -94,7 +94,7 @@ void __init paging_init(void) | |||
94 | 94 | ||
95 | /* I really wish I knew why the following change made things better... -- Sam */ | 95 | /* I really wish I knew why the following change made things better... -- Sam */ |
96 | /* free_area_init(zones_size); */ | 96 | /* free_area_init(zones_size); */ |
97 | free_area_init_node(0, NODE_DATA(0), zones_size, | 97 | free_area_init_node(0, zones_size, |
98 | (__pa(PAGE_OFFSET) >> PAGE_SHIFT) + 1, NULL); | 98 | (__pa(PAGE_OFFSET) >> PAGE_SHIFT) + 1, NULL); |
99 | 99 | ||
100 | 100 | ||
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c index 0ddf4904640a..7c155c254e72 100644 --- a/arch/parisc/mm/init.c +++ b/arch/parisc/mm/init.c | |||
@@ -887,7 +887,7 @@ void __init paging_init(void) | |||
887 | } | 887 | } |
888 | #endif | 888 | #endif |
889 | 889 | ||
890 | free_area_init_node(i, NODE_DATA(i), zones_size, | 890 | free_area_init_node(i, zones_size, |
891 | pmem_ranges[i].start_pfn, NULL); | 891 | pmem_ranges[i].start_pfn, NULL); |
892 | } | 892 | } |
893 | } | 893 | } |
diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c index c624e04ff03e..ee30462598fc 100644 --- a/arch/sparc/mm/srmmu.c +++ b/arch/sparc/mm/srmmu.c | |||
@@ -1352,8 +1352,7 @@ void __init srmmu_paging_init(void) | |||
1352 | zones_size[ZONE_HIGHMEM] = npages; | 1352 | zones_size[ZONE_HIGHMEM] = npages; |
1353 | zholes_size[ZONE_HIGHMEM] = npages - calc_highpages(); | 1353 | zholes_size[ZONE_HIGHMEM] = npages - calc_highpages(); |
1354 | 1354 | ||
1355 | free_area_init_node(0, &contig_page_data, zones_size, | 1355 | free_area_init_node(0, zones_size, pfn_base, zholes_size); |
1356 | pfn_base, zholes_size); | ||
1357 | } | 1356 | } |
1358 | } | 1357 | } |
1359 | 1358 | ||
diff --git a/arch/sparc/mm/sun4c.c b/arch/sparc/mm/sun4c.c index 2375fe9dc312..d1782f6368be 100644 --- a/arch/sparc/mm/sun4c.c +++ b/arch/sparc/mm/sun4c.c | |||
@@ -2123,8 +2123,7 @@ void __init sun4c_paging_init(void) | |||
2123 | zones_size[ZONE_HIGHMEM] = npages; | 2123 | zones_size[ZONE_HIGHMEM] = npages; |
2124 | zholes_size[ZONE_HIGHMEM] = npages - calc_highpages(); | 2124 | zholes_size[ZONE_HIGHMEM] = npages - calc_highpages(); |
2125 | 2125 | ||
2126 | free_area_init_node(0, &contig_page_data, zones_size, | 2126 | free_area_init_node(0, zones_size, pfn_base, zholes_size); |
2127 | pfn_base, zholes_size); | ||
2128 | } | 2127 | } |
2129 | 2128 | ||
2130 | cnt = 0; | 2129 | cnt = 0; |
diff --git a/arch/v850/kernel/setup.c b/arch/v850/kernel/setup.c index a0a8456a8430..10335cecf7bd 100644 --- a/arch/v850/kernel/setup.c +++ b/arch/v850/kernel/setup.c | |||
@@ -295,8 +295,7 @@ init_mem_alloc (unsigned long ram_start, unsigned long ram_len) | |||
295 | #error MAX_ORDER is too large for given PAGE_OFFSET (use CONFIG_FORCE_MAX_ZONEORDER to change it) | 295 | #error MAX_ORDER is too large for given PAGE_OFFSET (use CONFIG_FORCE_MAX_ZONEORDER to change it) |
296 | #endif | 296 | #endif |
297 | NODE_DATA(0)->node_mem_map = NULL; | 297 | NODE_DATA(0)->node_mem_map = NULL; |
298 | free_area_init_node (0, NODE_DATA(0), zones_size, | 298 | free_area_init_node(0, zones_size, ADDR_TO_PAGE (PAGE_OFFSET), 0); |
299 | ADDR_TO_PAGE (PAGE_OFFSET), 0); | ||
300 | } | 299 | } |
301 | 300 | ||
302 | 301 | ||
diff --git a/include/linux/mm.h b/include/linux/mm.h index f8071097302a..196924b657bc 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -962,9 +962,8 @@ static inline void pgtable_page_dtor(struct page *page) | |||
962 | NULL: pte_offset_kernel(pmd, address)) | 962 | NULL: pte_offset_kernel(pmd, address)) |
963 | 963 | ||
964 | extern void free_area_init(unsigned long * zones_size); | 964 | extern void free_area_init(unsigned long * zones_size); |
965 | extern void free_area_init_node(int nid, pg_data_t *pgdat, | 965 | extern void free_area_init_node(int nid, unsigned long * zones_size, |
966 | unsigned long * zones_size, unsigned long zone_start_pfn, | 966 | unsigned long zone_start_pfn, unsigned long *zholes_size); |
967 | unsigned long *zholes_size); | ||
968 | #ifdef CONFIG_ARCH_POPULATES_NODE_MAP | 967 | #ifdef CONFIG_ARCH_POPULATES_NODE_MAP |
969 | /* | 968 | /* |
970 | * With CONFIG_ARCH_POPULATES_NODE_MAP set, an architecture may initialise its | 969 | * With CONFIG_ARCH_POPULATES_NODE_MAP set, an architecture may initialise its |
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 833f854eabe5..6e26adc08f14 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c | |||
@@ -455,7 +455,7 @@ static pg_data_t *hotadd_new_pgdat(int nid, u64 start) | |||
455 | /* we can use NODE_DATA(nid) from here */ | 455 | /* we can use NODE_DATA(nid) from here */ |
456 | 456 | ||
457 | /* init node's zones as empty zones, we don't have any present pages.*/ | 457 | /* init node's zones as empty zones, we don't have any present pages.*/ |
458 | free_area_init_node(nid, pgdat, zones_size, start_pfn, zholes_size); | 458 | free_area_init_node(nid, zones_size, start_pfn, zholes_size); |
459 | 459 | ||
460 | return pgdat; | 460 | return pgdat; |
461 | } | 461 | } |
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 24aa3d1b9d96..e43aae135b38 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -3461,10 +3461,11 @@ static void __init_refok alloc_node_mem_map(struct pglist_data *pgdat) | |||
3461 | #endif /* CONFIG_FLAT_NODE_MEM_MAP */ | 3461 | #endif /* CONFIG_FLAT_NODE_MEM_MAP */ |
3462 | } | 3462 | } |
3463 | 3463 | ||
3464 | void __paginginit free_area_init_node(int nid, struct pglist_data *pgdat, | 3464 | void __paginginit free_area_init_node(int nid, unsigned long *zones_size, |
3465 | unsigned long *zones_size, unsigned long node_start_pfn, | 3465 | unsigned long node_start_pfn, unsigned long *zholes_size) |
3466 | unsigned long *zholes_size) | ||
3467 | { | 3466 | { |
3467 | pg_data_t *pgdat = NODE_DATA(nid); | ||
3468 | |||
3468 | pgdat->node_id = nid; | 3469 | pgdat->node_id = nid; |
3469 | pgdat->node_start_pfn = node_start_pfn; | 3470 | pgdat->node_start_pfn = node_start_pfn; |
3470 | calculate_node_totalpages(pgdat, zones_size, zholes_size); | 3471 | calculate_node_totalpages(pgdat, zones_size, zholes_size); |
@@ -3961,7 +3962,7 @@ void __init free_area_init_nodes(unsigned long *max_zone_pfn) | |||
3961 | setup_nr_node_ids(); | 3962 | setup_nr_node_ids(); |
3962 | for_each_online_node(nid) { | 3963 | for_each_online_node(nid) { |
3963 | pg_data_t *pgdat = NODE_DATA(nid); | 3964 | pg_data_t *pgdat = NODE_DATA(nid); |
3964 | free_area_init_node(nid, pgdat, NULL, | 3965 | free_area_init_node(nid, NULL, |
3965 | find_min_pfn_for_node(nid), NULL); | 3966 | find_min_pfn_for_node(nid), NULL); |
3966 | 3967 | ||
3967 | /* Any memory on that node */ | 3968 | /* Any memory on that node */ |
@@ -4032,7 +4033,7 @@ EXPORT_SYMBOL(contig_page_data); | |||
4032 | 4033 | ||
4033 | void __init free_area_init(unsigned long *zones_size) | 4034 | void __init free_area_init(unsigned long *zones_size) |
4034 | { | 4035 | { |
4035 | free_area_init_node(0, NODE_DATA(0), zones_size, | 4036 | free_area_init_node(0, zones_size, |
4036 | __pa(PAGE_OFFSET) >> PAGE_SHIFT, NULL); | 4037 | __pa(PAGE_OFFSET) >> PAGE_SHIFT, NULL); |
4037 | } | 4038 | } |
4038 | 4039 | ||