]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - mm/page_alloc.c
[PATCH] Use Zoned VM Counters for NUMA statistics
[karo-tx-linux.git] / mm / page_alloc.c
index 87dc1297fe39691dfc9dbb16d84a07f75ba3c889..d61671260f924fce3d6d40e98d7b8578d41f739e 100644 (file)
@@ -709,27 +709,6 @@ void drain_local_pages(void)
 }
 #endif /* CONFIG_PM */
 
-static void zone_statistics(struct zonelist *zonelist, struct zone *z, int cpu)
-{
-#ifdef CONFIG_NUMA
-       pg_data_t *pg = z->zone_pgdat;
-       pg_data_t *orig = zonelist->zones[0]->zone_pgdat;
-       struct per_cpu_pageset *p;
-
-       p = zone_pcp(z, cpu);
-       if (pg == orig) {
-               p->numa_hit++;
-       } else {
-               p->numa_miss++;
-               zone_pcp(zonelist->zones[0], cpu)->numa_foreign++;
-       }
-       if (pg == NODE_DATA(numa_node_id()))
-               p->local_node++;
-       else
-               p->other_node++;
-#endif
-}
-
 /*
  * Free a 0-order page
  */
@@ -827,7 +806,7 @@ again:
        }
 
        __mod_page_state_zone(zone, pgalloc, 1 << order);
-       zone_statistics(zonelist, zone, cpu);
+       zone_statistics(zonelist, zone);
        local_irq_restore(flags);
        put_cpu();
 
@@ -1271,7 +1250,6 @@ void si_meminfo_node(struct sysinfo *val, int nid)
  */
 void show_free_areas(void)
 {
-       struct page_state ps;
        int cpu, temperature;
        unsigned long active;
        unsigned long inactive;
@@ -1303,7 +1281,6 @@ void show_free_areas(void)
                }
        }
 
-       get_page_state(&ps);
        get_zone_counts(&active, &inactive, &free);
 
        printk("Free pages: %11ukB (%ukB HighMem)\n",
@@ -1314,13 +1291,13 @@ void show_free_areas(void)
                "unstable:%lu free:%u slab:%lu mapped:%lu pagetables:%lu\n",
                active,
                inactive,
-               ps.nr_dirty,
-               ps.nr_writeback,
-               ps.nr_unstable,
+               global_page_state(NR_FILE_DIRTY),
+               global_page_state(NR_WRITEBACK),
+               global_page_state(NR_UNSTABLE_NFS),
                nr_free_pages(),
-               ps.nr_slab,
-               ps.nr_mapped,
-               ps.nr_page_table_pages);
+               global_page_state(NR_SLAB),
+               global_page_state(NR_FILE_MAPPED),
+               global_page_state(NR_PAGETABLE));
 
        for_each_zone(zone) {
                int i;
@@ -2045,6 +2022,7 @@ static void __meminit free_area_init_core(struct pglist_data *pgdat,
                zone->nr_scan_inactive = 0;
                zone->nr_active = 0;
                zone->nr_inactive = 0;
+               zap_zone_vm_stats(zone);
                atomic_set(&zone->reclaim_in_progress, 0);
                if (!size)
                        continue;
@@ -2123,16 +2101,11 @@ static int page_alloc_cpu_notify(struct notifier_block *self,
                                 unsigned long action, void *hcpu)
 {
        int cpu = (unsigned long)hcpu;
-       long *count;
        unsigned long *src, *dest;
 
        if (action == CPU_DEAD) {
                int i;
 
-               /* Drain local pagecache count. */
-               count = &per_cpu(nr_pagecache_local, cpu);
-               atomic_add(*count, &nr_pagecache);
-               *count = 0;
                local_irq_disable();
                __drain_pages(cpu);
 
@@ -2147,6 +2120,7 @@ static int page_alloc_cpu_notify(struct notifier_block *self,
                }
 
                local_irq_enable();
+               refresh_cpu_vm_stats(cpu);
        }
        return NOTIFY_OK;
 }