diff --git a/mm/vmstat.c b/mm/vmstat.c index e361c2b3a8bc..34de8530aa4e 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -31,7 +31,10 @@ #include "internal.h" +#ifdef CONFIG_SMP static int vmstat_late_init_done; +#endif /* CONFIG_SMP */ + #ifdef CONFIG_NUMA int sysctl_vm_numa_stat = ENABLE_NUMA_STAT; @@ -102,7 +105,7 @@ int sysctl_vm_numa_stat_handler(const struct ctl_table *table, int write, mutex_unlock(&vm_numa_stat_lock); return ret; } -#endif +#endif /* CONFIG_NUMA */ #ifdef CONFIG_VM_EVENT_COUNTERS DEFINE_PER_CPU(struct vm_event_state, vm_event_states) = {{0}}; @@ -192,7 +195,7 @@ void fold_vm_numa_events(void) for_each_populated_zone(zone) fold_vm_zone_numa_events(zone); } -#endif +#endif /* CONFIG_NUMA */ #ifdef CONFIG_SMP @@ -765,7 +768,7 @@ void dec_node_page_state(struct page *page, enum node_stat_item item) local_irq_restore(flags); } EXPORT_SYMBOL(dec_node_page_state); -#endif +#endif /* CONFIG_HAVE_CMPXCHG_LOCAL */ /* * Fold a differential into the global counters. @@ -830,7 +833,7 @@ static int refresh_cpu_vm_stats(bool do_pagesets) #ifdef CONFIG_NUMA /* 3 seconds idle till flush */ __this_cpu_write(pcp->expire, 3); -#endif +#endif /* CONFIG_NUMA */ } } @@ -867,7 +870,7 @@ static int refresh_cpu_vm_stats(bool do_pagesets) drain_zone_pages(zone, this_cpu_ptr(pcp)); changes++; } -#endif +#endif /* CONFIG_NUMA */ } } @@ -927,7 +930,7 @@ void cpu_vm_stats_fold(int cpu) zone_numa_event_add(v, zone, i); } } -#endif +#endif /* CONFIG_NUMA */ } for_each_online_pgdat(pgdat) { @@ -974,9 +977,9 @@ void drain_zonestat(struct zone *zone, struct per_cpu_zonestat *pzstats) zone_numa_event_add(v, zone, i); } } -#endif +#endif /* CONFIG_NUMA */ } -#endif +#endif /* CONFIG_SMP */ #ifdef CONFIG_NUMA /* @@ -1021,7 +1024,7 @@ unsigned long node_page_state_pages(struct pglist_data *pgdat, #ifdef CONFIG_SMP if (x < 0) x = 0; -#endif +#endif /* CONFIG_SMP */ return x; } @@ -1032,7 +1035,7 @@ unsigned long node_page_state(struct pglist_data *pgdat, return node_page_state_pages(pgdat, item); } -#endif +#endif /* CONFIG_NUMA */ /* * Count number of pages "struct page" and "struct page_ext" consume. @@ -1156,7 +1159,7 @@ int fragmentation_index(struct zone *zone, unsigned int order) fill_contig_page_info(zone, order, &info); return __fragmentation_index(order, &info); } -#endif +#endif /* CONFIG_COMPACTION */ #if defined(CONFIG_PROC_FS) || defined(CONFIG_SYSFS) || \ defined(CONFIG_NUMA) || defined(CONFIG_MEMCG) @@ -1397,7 +1400,7 @@ const char * const vmstat_text[] = { "thp_zero_page_alloc_failed", "thp_swpout", "thp_swpout_fallback", -#endif +#endif /*CONFIG_TRANSPARENT_HUGEPAGE */ #ifdef CONFIG_MEMORY_BALLOON "balloon_inflate", "balloon_deflate", @@ -1417,8 +1420,8 @@ const char * const vmstat_text[] = { "swap_ra_hit", #ifdef CONFIG_KSM "ksm_swpin_copy", -#endif -#endif +#endif /* CONFIG_KSM */ +#endif /* CONFIG_SWAP */ #ifdef CONFIG_KSM "cow_ksm", #endif @@ -1460,7 +1463,7 @@ const char * const vmstat_text[] = { #if THREAD_SIZE > 65536 "kstack_rest", #endif -#endif +#endif /* CONFIG_DEBUG_STACK_USAGE */ #endif /* CONFIG_VM_EVENT_COUNTERS || CONFIG_MEMCG */ }; #endif /* CONFIG_PROC_FS || CONFIG_SYSFS || CONFIG_NUMA || CONFIG_MEMCG */ @@ -1515,7 +1518,7 @@ static void walk_zones_in_node(struct seq_file *m, pg_data_t *pgdat, spin_unlock_irqrestore(&zone->lock, flags); } } -#endif +#endif /* CONFIG_DEBUG_FS && CONFIG_COMPACTION || CONFIG_PROC_FS */ #ifdef CONFIG_PROC_FS static void frag_show_print(struct seq_file *m, pg_data_t *pgdat, @@ -2172,7 +2175,7 @@ static int __init vmstat_late_init(void) return 0; } late_initcall(vmstat_late_init); -#endif +#endif /* CONFIG_SMP */ struct workqueue_struct *mm_percpu_wq; @@ -2199,13 +2202,13 @@ void __init init_mm_internals(void) cpus_read_unlock(); start_shepherd_timer(); -#endif +#endif /* CONFIG_SMP */ #ifdef CONFIG_PROC_FS proc_create_seq("buddyinfo", 0444, NULL, &fragmentation_op); proc_create_seq("pagetypeinfo", 0400, NULL, &pagetypeinfo_op); proc_create_seq("vmstat", 0444, NULL, &vmstat_op); proc_create_seq("zoneinfo", 0444, NULL, &zoneinfo_op); -#endif +#endif /* CONFIG_PROC_FS */ } #if defined(CONFIG_DEBUG_FS) && defined(CONFIG_COMPACTION) @@ -2341,4 +2344,4 @@ static int __init extfrag_debug_init(void) module_init(extfrag_debug_init); -#endif +#endif /* CONFIG_DEBUG_FS && CONFIG_COMPACTION */