Commit ec936fc5 authored by KAMEZAWA Hiroyuki's avatar KAMEZAWA Hiroyuki Committed by Linus Torvalds

[PATCH] for_each_online_pgdat: renaming for_each_pgdat

Replace for_each_pgdat() with for_each_online_pgdat().
Signed-off-by: default avatarKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 679bc9fb
...@@ -36,7 +36,7 @@ void show_mem(void) ...@@ -36,7 +36,7 @@ void show_mem(void)
printk(KERN_INFO "Mem-info:\n"); printk(KERN_INFO "Mem-info:\n");
show_free_areas(); show_free_areas();
printk(KERN_INFO "Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10)); printk(KERN_INFO "Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
for_each_pgdat(pgdat) { for_each_online_pgdat(pgdat) {
pgdat_resize_lock(pgdat, &flags); pgdat_resize_lock(pgdat, &flags);
for (i = 0; i < pgdat->node_spanned_pages; ++i) { for (i = 0; i < pgdat->node_spanned_pages; ++i) {
page = pgdat_page_nr(pgdat, i); page = pgdat_page_nr(pgdat, i);
......
...@@ -386,7 +386,7 @@ static void __init pgdat_insert(pg_data_t *pgdat) ...@@ -386,7 +386,7 @@ static void __init pgdat_insert(pg_data_t *pgdat)
{ {
pg_data_t *prev = NULL, *next; pg_data_t *prev = NULL, *next;
for_each_pgdat(next) for_each_online_pgdat(next)
if (pgdat->node_id < next->node_id) if (pgdat->node_id < next->node_id)
break; break;
else else
...@@ -560,7 +560,7 @@ void show_mem(void) ...@@ -560,7 +560,7 @@ void show_mem(void)
printk("Mem-info:\n"); printk("Mem-info:\n");
show_free_areas(); show_free_areas();
printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10)); printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
for_each_pgdat(pgdat) { for_each_online_pgdat(pgdat) {
unsigned long present; unsigned long present;
unsigned long flags; unsigned long flags;
int shared = 0, cached = 0, reserved = 0; int shared = 0, cached = 0, reserved = 0;
......
...@@ -600,7 +600,7 @@ mem_init (void) ...@@ -600,7 +600,7 @@ mem_init (void)
kclist_add(&kcore_vmem, (void *)VMALLOC_START, VMALLOC_END-VMALLOC_START); kclist_add(&kcore_vmem, (void *)VMALLOC_START, VMALLOC_END-VMALLOC_START);
kclist_add(&kcore_kernel, _stext, _end - _stext); kclist_add(&kcore_kernel, _stext, _end - _stext);
for_each_pgdat(pgdat) for_each_online_pgdat(pgdat)
if (pgdat->bdata->node_bootmem_map) if (pgdat->bdata->node_bootmem_map)
totalram_pages += free_all_bootmem_node(pgdat); totalram_pages += free_all_bootmem_node(pgdat);
......
...@@ -47,7 +47,7 @@ void show_mem(void) ...@@ -47,7 +47,7 @@ void show_mem(void)
printk("Mem-info:\n"); printk("Mem-info:\n");
show_free_areas(); show_free_areas();
printk("Free swap: %6ldkB\n",nr_swap_pages<<(PAGE_SHIFT-10)); printk("Free swap: %6ldkB\n",nr_swap_pages<<(PAGE_SHIFT-10));
for_each_pgdat(pgdat) { for_each_online_pgdat(pgdat) {
unsigned long flags; unsigned long flags;
pgdat_resize_lock(pgdat, &flags); pgdat_resize_lock(pgdat, &flags);
for (i = 0; i < pgdat->node_spanned_pages; ++i) { for (i = 0; i < pgdat->node_spanned_pages; ++i) {
......
...@@ -195,7 +195,7 @@ void show_mem(void) ...@@ -195,7 +195,7 @@ void show_mem(void)
printk("Mem-info:\n"); printk("Mem-info:\n");
show_free_areas(); show_free_areas();
printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10)); printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
for_each_pgdat(pgdat) { for_each_online_pgdat(pgdat) {
unsigned long flags; unsigned long flags;
pgdat_resize_lock(pgdat, &flags); pgdat_resize_lock(pgdat, &flags);
for (i = 0; i < pgdat->node_spanned_pages; i++) { for (i = 0; i < pgdat->node_spanned_pages; i++) {
...@@ -351,7 +351,7 @@ void __init mem_init(void) ...@@ -351,7 +351,7 @@ void __init mem_init(void)
max_mapnr = max_pfn; max_mapnr = max_pfn;
totalram_pages += free_all_bootmem(); totalram_pages += free_all_bootmem();
#endif #endif
for_each_pgdat(pgdat) { for_each_online_pgdat(pgdat) {
for (i = 0; i < pgdat->node_spanned_pages; i++) { for (i = 0; i < pgdat->node_spanned_pages; i++) {
if (!pfn_valid(pgdat->node_start_pfn + i)) if (!pfn_valid(pgdat->node_start_pfn + i))
continue; continue;
......
...@@ -72,7 +72,7 @@ void show_mem(void) ...@@ -72,7 +72,7 @@ void show_mem(void)
show_free_areas(); show_free_areas();
printk(KERN_INFO "Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10)); printk(KERN_INFO "Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
for_each_pgdat(pgdat) { for_each_online_pgdat(pgdat) {
for (i = 0; i < pgdat->node_spanned_pages; ++i) { for (i = 0; i < pgdat->node_spanned_pages; ++i) {
page = pfn_to_page(pgdat->node_start_pfn + i); page = pfn_to_page(pgdat->node_start_pfn + i);
total++; total++;
......
...@@ -493,7 +493,7 @@ static void free_more_memory(void) ...@@ -493,7 +493,7 @@ static void free_more_memory(void)
wakeup_pdflush(1024); wakeup_pdflush(1024);
yield(); yield();
for_each_pgdat(pgdat) { for_each_online_pgdat(pgdat) {
zones = pgdat->node_zonelists[gfp_zone(GFP_NOFS)].zones; zones = pgdat->node_zonelists[gfp_zone(GFP_NOFS)].zones;
if (*zones) if (*zones)
try_to_free_pages(zones, GFP_NOFS); try_to_free_pages(zones, GFP_NOFS);
......
...@@ -1201,7 +1201,7 @@ unsigned int nr_free_highpages (void) ...@@ -1201,7 +1201,7 @@ unsigned int nr_free_highpages (void)
pg_data_t *pgdat; pg_data_t *pgdat;
unsigned int pages = 0; unsigned int pages = 0;
for_each_pgdat(pgdat) for_each_online_pgdat(pgdat)
pages += pgdat->node_zones[ZONE_HIGHMEM].free_pages; pages += pgdat->node_zones[ZONE_HIGHMEM].free_pages;
return pages; return pages;
...@@ -1343,7 +1343,7 @@ void get_zone_counts(unsigned long *active, ...@@ -1343,7 +1343,7 @@ void get_zone_counts(unsigned long *active,
*active = 0; *active = 0;
*inactive = 0; *inactive = 0;
*free = 0; *free = 0;
for_each_pgdat(pgdat) { for_each_online_pgdat(pgdat) {
unsigned long l, m, n; unsigned long l, m, n;
__get_zone_counts(&l, &m, &n, pgdat); __get_zone_counts(&l, &m, &n, pgdat);
*active += l; *active += l;
...@@ -2482,7 +2482,7 @@ static void setup_per_zone_lowmem_reserve(void) ...@@ -2482,7 +2482,7 @@ static void setup_per_zone_lowmem_reserve(void)
struct pglist_data *pgdat; struct pglist_data *pgdat;
int j, idx; int j, idx;
for_each_pgdat(pgdat) { for_each_online_pgdat(pgdat) {
for (j = 0; j < MAX_NR_ZONES; j++) { for (j = 0; j < MAX_NR_ZONES; j++) {
struct zone *zone = pgdat->node_zones + j; struct zone *zone = pgdat->node_zones + j;
unsigned long present_pages = zone->present_pages; unsigned long present_pages = zone->present_pages;
......
...@@ -1305,7 +1305,7 @@ unsigned long shrink_all_memory(unsigned long nr_pages) ...@@ -1305,7 +1305,7 @@ unsigned long shrink_all_memory(unsigned long nr_pages)
current->reclaim_state = &reclaim_state; current->reclaim_state = &reclaim_state;
repeat: repeat:
for_each_pgdat(pgdat) { for_each_online_pgdat(pgdat) {
unsigned long freed; unsigned long freed;
freed = balance_pgdat(pgdat, nr_to_free, 0); freed = balance_pgdat(pgdat, nr_to_free, 0);
...@@ -1335,7 +1335,7 @@ static int __devinit cpu_callback(struct notifier_block *nfb, ...@@ -1335,7 +1335,7 @@ static int __devinit cpu_callback(struct notifier_block *nfb,
cpumask_t mask; cpumask_t mask;
if (action == CPU_ONLINE) { if (action == CPU_ONLINE) {
for_each_pgdat(pgdat) { for_each_online_pgdat(pgdat) {
mask = node_to_cpumask(pgdat->node_id); mask = node_to_cpumask(pgdat->node_id);
if (any_online_cpu(mask) != NR_CPUS) if (any_online_cpu(mask) != NR_CPUS)
/* One of our CPUs online: restore mask */ /* One of our CPUs online: restore mask */
...@@ -1351,7 +1351,7 @@ static int __init kswapd_init(void) ...@@ -1351,7 +1351,7 @@ static int __init kswapd_init(void)
pg_data_t *pgdat; pg_data_t *pgdat;
swap_setup(); swap_setup();
for_each_pgdat(pgdat) { for_each_online_pgdat(pgdat) {
pid_t pid; pid_t pid;
pid = kernel_thread(kswapd, pgdat, CLONE_KERNEL); pid = kernel_thread(kswapd, pgdat, CLONE_KERNEL);
......
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