vfs: fix data corruption when blocksize < pagesize for mmaped data
[platform/adaptation/renesas_rcar/renesas_kernel.git] / mm / vmstat.c
index 9bb3145..def5dd2 100644 (file)
@@ -812,6 +812,7 @@ const char * const vmstat_text[] = {
 
 #ifdef CONFIG_NUMA_BALANCING
        "numa_pte_updates",
+       "numa_huge_pte_updates",
        "numa_hint_faults",
        "numa_hint_faults_local",
        "numa_pages_migrated",
@@ -850,12 +851,14 @@ const char * const vmstat_text[] = {
        "thp_zero_page_alloc",
        "thp_zero_page_alloc_failed",
 #endif
+#ifdef CONFIG_DEBUG_TLBFLUSH
 #ifdef CONFIG_SMP
        "nr_tlb_remote_flush",
        "nr_tlb_remote_flush_received",
-#endif
+#endif /* CONFIG_SMP */
        "nr_tlb_local_flush_all",
        "nr_tlb_local_flush_one",
+#endif /* CONFIG_DEBUG_TLBFLUSH */
 
 #endif /* CONFIG_VM_EVENTS_COUNTERS */
 };
@@ -1229,6 +1232,20 @@ static void start_cpu_timer(int cpu)
        schedule_delayed_work_on(cpu, work, __round_jiffies_relative(HZ, cpu));
 }
 
+static void vmstat_cpu_dead(int node)
+{
+       int cpu;
+
+       get_online_cpus();
+       for_each_online_cpu(cpu)
+               if (cpu_to_node(cpu) == node)
+                       goto end;
+
+       node_clear_state(node, N_CPU);
+end:
+       put_online_cpus();
+}
+
 /*
  * Use the cpu notifier to insure that the thresholds are recalculated
  * when necessary.
@@ -1258,6 +1275,7 @@ static int vmstat_cpuup_callback(struct notifier_block *nfb,
        case CPU_DEAD:
        case CPU_DEAD_FROZEN:
                refresh_zone_stat_thresholds();
+               vmstat_cpu_dead(cpu_to_node(cpu));
                break;
        default:
                break;
@@ -1276,8 +1294,12 @@ static int __init setup_vmstat(void)
 
        register_cpu_notifier(&vmstat_notifier);
 
-       for_each_online_cpu(cpu)
+       get_online_cpus();
+       for_each_online_cpu(cpu) {
                start_cpu_timer(cpu);
+               node_set_state(cpu_to_node(cpu), N_CPU);
+       }
+       put_online_cpus();
 #endif
 #ifdef CONFIG_PROC_FS
        proc_create("buddyinfo", S_IRUGO, NULL, &fragmentation_file_operations);