mm, vmstat: allow WQ concurrency to discover memory reclaim doesn't make any progress
[pandora-kernel.git] / mm / vmstat.c
index d52b13d..14d8cb4 100644 (file)
@@ -78,7 +78,7 @@ void vm_events_fold_cpu(int cpu)
  *
  * vm_stat contains the global counters
  */
-atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS];
+atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS] __cacheline_aligned_in_smp;
 EXPORT_SYMBOL(vm_stat);
 
 #ifdef CONFIG_SMP
@@ -702,6 +702,7 @@ const char * const vmstat_text[] = {
        "nr_unstable",
        "nr_bounce",
        "nr_vmscan_write",
+       "nr_vmscan_immediate_reclaim",
        "nr_writeback_temp",
        "nr_isolated_anon",
        "nr_isolated_file",
@@ -1138,13 +1139,14 @@ static const struct file_operations proc_vmstat_file_operations = {
 #endif /* CONFIG_PROC_FS */
 
 #ifdef CONFIG_SMP
+static struct workqueue_struct *vmstat_wq;
 static DEFINE_PER_CPU(struct delayed_work, vmstat_work);
 int sysctl_stat_interval __read_mostly = HZ;
 
 static void vmstat_update(struct work_struct *w)
 {
        refresh_cpu_vm_stats(smp_processor_id());
-       schedule_delayed_work(&__get_cpu_var(vmstat_work),
+       queue_delayed_work(vmstat_wq, &__get_cpu_var(vmstat_work),
                round_jiffies_relative(sysctl_stat_interval));
 }
 
@@ -1153,7 +1155,7 @@ static void __cpuinit start_cpu_timer(int cpu)
        struct delayed_work *work = &per_cpu(vmstat_work, cpu);
 
        INIT_DELAYED_WORK_DEFERRABLE(work, vmstat_update);
-       schedule_delayed_work_on(cpu, work, __round_jiffies_relative(HZ, cpu));
+       queue_delayed_work_on(cpu, vmstat_wq, work, __round_jiffies_relative(HZ, cpu));
 }
 
 /*
@@ -1203,6 +1205,7 @@ static int __init setup_vmstat(void)
 
        register_cpu_notifier(&vmstat_notifier);
 
+       vmstat_wq = alloc_workqueue("vmstat", WQ_FREEZABLE|WQ_MEM_RECLAIM, 0);
        for_each_online_cpu(cpu)
                start_cpu_timer(cpu);
 #endif