diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
commit | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch) | |
tree | a8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /mm/vmstat.c | |
parent | 406089d01562f1e2bf9f089fd7637009ebaad589 (diff) |
Patched in Tegra support.
Diffstat (limited to 'mm/vmstat.c')
-rw-r--r-- | mm/vmstat.c | 67 |
1 files changed, 16 insertions, 51 deletions
diff --git a/mm/vmstat.c b/mm/vmstat.c index 9800306c819..d52b13d28e8 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c | |||
@@ -78,7 +78,7 @@ void vm_events_fold_cpu(int cpu) | |||
78 | * | 78 | * |
79 | * vm_stat contains the global counters | 79 | * vm_stat contains the global counters |
80 | */ | 80 | */ |
81 | atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS] __cacheline_aligned_in_smp; | 81 | atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS]; |
82 | EXPORT_SYMBOL(vm_stat); | 82 | EXPORT_SYMBOL(vm_stat); |
83 | 83 | ||
84 | #ifdef CONFIG_SMP | 84 | #ifdef CONFIG_SMP |
@@ -295,7 +295,7 @@ void __dec_zone_page_state(struct page *page, enum zone_stat_item item) | |||
295 | } | 295 | } |
296 | EXPORT_SYMBOL(__dec_zone_page_state); | 296 | EXPORT_SYMBOL(__dec_zone_page_state); |
297 | 297 | ||
298 | #ifdef CONFIG_HAVE_CMPXCHG_LOCAL | 298 | #ifdef CONFIG_CMPXCHG_LOCAL |
299 | /* | 299 | /* |
300 | * If we have cmpxchg_local support then we do not need to incur the overhead | 300 | * If we have cmpxchg_local support then we do not need to incur the overhead |
301 | * that comes with local_irq_save/restore if we use this_cpu_cmpxchg. | 301 | * that comes with local_irq_save/restore if we use this_cpu_cmpxchg. |
@@ -495,18 +495,6 @@ void refresh_cpu_vm_stats(int cpu) | |||
495 | atomic_long_add(global_diff[i], &vm_stat[i]); | 495 | atomic_long_add(global_diff[i], &vm_stat[i]); |
496 | } | 496 | } |
497 | 497 | ||
498 | void drain_zonestat(struct zone *zone, struct per_cpu_pageset *pset) | ||
499 | { | ||
500 | int i; | ||
501 | |||
502 | for (i = 0; i < NR_VM_ZONE_STAT_ITEMS; i++) | ||
503 | if (pset->vm_stat_diff[i]) { | ||
504 | int v = pset->vm_stat_diff[i]; | ||
505 | pset->vm_stat_diff[i] = 0; | ||
506 | atomic_long_add(v, &zone->vm_stat[i]); | ||
507 | atomic_long_add(v, &vm_stat[i]); | ||
508 | } | ||
509 | } | ||
510 | #endif | 498 | #endif |
511 | 499 | ||
512 | #ifdef CONFIG_NUMA | 500 | #ifdef CONFIG_NUMA |
@@ -625,9 +613,6 @@ static char * const migratetype_names[MIGRATE_TYPES] = { | |||
625 | "Reclaimable", | 613 | "Reclaimable", |
626 | "Movable", | 614 | "Movable", |
627 | "Reserve", | 615 | "Reserve", |
628 | #ifdef CONFIG_CMA | ||
629 | "CMA", | ||
630 | #endif | ||
631 | "Isolate", | 616 | "Isolate", |
632 | }; | 617 | }; |
633 | 618 | ||
@@ -717,7 +702,6 @@ const char * const vmstat_text[] = { | |||
717 | "nr_unstable", | 702 | "nr_unstable", |
718 | "nr_bounce", | 703 | "nr_bounce", |
719 | "nr_vmscan_write", | 704 | "nr_vmscan_write", |
720 | "nr_vmscan_immediate_reclaim", | ||
721 | "nr_writeback_temp", | 705 | "nr_writeback_temp", |
722 | "nr_isolated_anon", | 706 | "nr_isolated_anon", |
723 | "nr_isolated_file", | 707 | "nr_isolated_file", |
@@ -734,7 +718,6 @@ const char * const vmstat_text[] = { | |||
734 | "numa_other", | 718 | "numa_other", |
735 | #endif | 719 | #endif |
736 | "nr_anon_transparent_hugepages", | 720 | "nr_anon_transparent_hugepages", |
737 | "nr_free_cma", | ||
738 | "nr_dirty_threshold", | 721 | "nr_dirty_threshold", |
739 | "nr_dirty_background_threshold", | 722 | "nr_dirty_background_threshold", |
740 | 723 | ||
@@ -754,17 +737,16 @@ const char * const vmstat_text[] = { | |||
754 | "pgmajfault", | 737 | "pgmajfault", |
755 | 738 | ||
756 | TEXTS_FOR_ZONES("pgrefill") | 739 | TEXTS_FOR_ZONES("pgrefill") |
757 | TEXTS_FOR_ZONES("pgsteal_kswapd") | 740 | TEXTS_FOR_ZONES("pgsteal") |
758 | TEXTS_FOR_ZONES("pgsteal_direct") | ||
759 | TEXTS_FOR_ZONES("pgscan_kswapd") | 741 | TEXTS_FOR_ZONES("pgscan_kswapd") |
760 | TEXTS_FOR_ZONES("pgscan_direct") | 742 | TEXTS_FOR_ZONES("pgscan_direct") |
761 | "pgscan_direct_throttle", | ||
762 | 743 | ||
763 | #ifdef CONFIG_NUMA | 744 | #ifdef CONFIG_NUMA |
764 | "zone_reclaim_failed", | 745 | "zone_reclaim_failed", |
765 | #endif | 746 | #endif |
766 | "pginodesteal", | 747 | "pginodesteal", |
767 | "slabs_scanned", | 748 | "slabs_scanned", |
749 | "kswapd_steal", | ||
768 | "kswapd_inodesteal", | 750 | "kswapd_inodesteal", |
769 | "kswapd_low_wmark_hit_quickly", | 751 | "kswapd_low_wmark_hit_quickly", |
770 | "kswapd_high_wmark_hit_quickly", | 752 | "kswapd_high_wmark_hit_quickly", |
@@ -774,20 +756,10 @@ const char * const vmstat_text[] = { | |||
774 | 756 | ||
775 | "pgrotated", | 757 | "pgrotated", |
776 | 758 | ||
777 | #ifdef CONFIG_NUMA_BALANCING | ||
778 | "numa_pte_updates", | ||
779 | "numa_hint_faults", | ||
780 | "numa_hint_faults_local", | ||
781 | "numa_pages_migrated", | ||
782 | #endif | ||
783 | #ifdef CONFIG_MIGRATION | ||
784 | "pgmigrate_success", | ||
785 | "pgmigrate_fail", | ||
786 | #endif | ||
787 | #ifdef CONFIG_COMPACTION | 759 | #ifdef CONFIG_COMPACTION |
788 | "compact_migrate_scanned", | 760 | "compact_blocks_moved", |
789 | "compact_free_scanned", | 761 | "compact_pages_moved", |
790 | "compact_isolated", | 762 | "compact_pagemigrate_failed", |
791 | "compact_stall", | 763 | "compact_stall", |
792 | "compact_fail", | 764 | "compact_fail", |
793 | "compact_success", | 765 | "compact_success", |
@@ -804,6 +776,7 @@ const char * const vmstat_text[] = { | |||
804 | "unevictable_pgs_munlocked", | 776 | "unevictable_pgs_munlocked", |
805 | "unevictable_pgs_cleared", | 777 | "unevictable_pgs_cleared", |
806 | "unevictable_pgs_stranded", | 778 | "unevictable_pgs_stranded", |
779 | "unevictable_pgs_mlockfreed", | ||
807 | 780 | ||
808 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | 781 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE |
809 | "thp_fault_alloc", | 782 | "thp_fault_alloc", |
@@ -811,8 +784,6 @@ const char * const vmstat_text[] = { | |||
811 | "thp_collapse_alloc", | 784 | "thp_collapse_alloc", |
812 | "thp_collapse_alloc_failed", | 785 | "thp_collapse_alloc_failed", |
813 | "thp_split", | 786 | "thp_split", |
814 | "thp_zero_page_alloc", | ||
815 | "thp_zero_page_alloc_failed", | ||
816 | #endif | 787 | #endif |
817 | 788 | ||
818 | #endif /* CONFIG_VM_EVENTS_COUNTERS */ | 789 | #endif /* CONFIG_VM_EVENTS_COUNTERS */ |
@@ -942,7 +913,7 @@ static int pagetypeinfo_show(struct seq_file *m, void *arg) | |||
942 | pg_data_t *pgdat = (pg_data_t *)arg; | 913 | pg_data_t *pgdat = (pg_data_t *)arg; |
943 | 914 | ||
944 | /* check memoryless node */ | 915 | /* check memoryless node */ |
945 | if (!node_state(pgdat->node_id, N_MEMORY)) | 916 | if (!node_state(pgdat->node_id, N_HIGH_MEMORY)) |
946 | return 0; | 917 | return 0; |
947 | 918 | ||
948 | seq_printf(m, "Page block order: %d\n", pageblock_order); | 919 | seq_printf(m, "Page block order: %d\n", pageblock_order); |
@@ -1004,16 +975,14 @@ static void zoneinfo_show_print(struct seq_file *m, pg_data_t *pgdat, | |||
1004 | "\n high %lu" | 975 | "\n high %lu" |
1005 | "\n scanned %lu" | 976 | "\n scanned %lu" |
1006 | "\n spanned %lu" | 977 | "\n spanned %lu" |
1007 | "\n present %lu" | 978 | "\n present %lu", |
1008 | "\n managed %lu", | ||
1009 | zone_page_state(zone, NR_FREE_PAGES), | 979 | zone_page_state(zone, NR_FREE_PAGES), |
1010 | min_wmark_pages(zone), | 980 | min_wmark_pages(zone), |
1011 | low_wmark_pages(zone), | 981 | low_wmark_pages(zone), |
1012 | high_wmark_pages(zone), | 982 | high_wmark_pages(zone), |
1013 | zone->pages_scanned, | 983 | zone->pages_scanned, |
1014 | zone->spanned_pages, | 984 | zone->spanned_pages, |
1015 | zone->present_pages, | 985 | zone->present_pages); |
1016 | zone->managed_pages); | ||
1017 | 986 | ||
1018 | for (i = 0; i < NR_VM_ZONE_STAT_ITEMS; i++) | 987 | for (i = 0; i < NR_VM_ZONE_STAT_ITEMS; i++) |
1019 | seq_printf(m, "\n %-12s %lu", vmstat_text[i], | 988 | seq_printf(m, "\n %-12s %lu", vmstat_text[i], |
@@ -1183,7 +1152,7 @@ static void __cpuinit start_cpu_timer(int cpu) | |||
1183 | { | 1152 | { |
1184 | struct delayed_work *work = &per_cpu(vmstat_work, cpu); | 1153 | struct delayed_work *work = &per_cpu(vmstat_work, cpu); |
1185 | 1154 | ||
1186 | INIT_DEFERRABLE_WORK(work, vmstat_update); | 1155 | INIT_DELAYED_WORK_DEFERRABLE(work, vmstat_update); |
1187 | schedule_delayed_work_on(cpu, work, __round_jiffies_relative(HZ, cpu)); | 1156 | schedule_delayed_work_on(cpu, work, __round_jiffies_relative(HZ, cpu)); |
1188 | } | 1157 | } |
1189 | 1158 | ||
@@ -1250,6 +1219,7 @@ module_init(setup_vmstat) | |||
1250 | #if defined(CONFIG_DEBUG_FS) && defined(CONFIG_COMPACTION) | 1219 | #if defined(CONFIG_DEBUG_FS) && defined(CONFIG_COMPACTION) |
1251 | #include <linux/debugfs.h> | 1220 | #include <linux/debugfs.h> |
1252 | 1221 | ||
1222 | static struct dentry *extfrag_debug_root; | ||
1253 | 1223 | ||
1254 | /* | 1224 | /* |
1255 | * Return an index indicating how much of the available free memory is | 1225 | * Return an index indicating how much of the available free memory is |
@@ -1306,7 +1276,7 @@ static int unusable_show(struct seq_file *m, void *arg) | |||
1306 | pg_data_t *pgdat = (pg_data_t *)arg; | 1276 | pg_data_t *pgdat = (pg_data_t *)arg; |
1307 | 1277 | ||
1308 | /* check memoryless node */ | 1278 | /* check memoryless node */ |
1309 | if (!node_state(pgdat->node_id, N_MEMORY)) | 1279 | if (!node_state(pgdat->node_id, N_HIGH_MEMORY)) |
1310 | return 0; | 1280 | return 0; |
1311 | 1281 | ||
1312 | walk_zones_in_node(m, pgdat, unusable_show_print); | 1282 | walk_zones_in_node(m, pgdat, unusable_show_print); |
@@ -1387,24 +1357,19 @@ static const struct file_operations extfrag_file_ops = { | |||
1387 | 1357 | ||
1388 | static int __init extfrag_debug_init(void) | 1358 | static int __init extfrag_debug_init(void) |
1389 | { | 1359 | { |
1390 | struct dentry *extfrag_debug_root; | ||
1391 | |||
1392 | extfrag_debug_root = debugfs_create_dir("extfrag", NULL); | 1360 | extfrag_debug_root = debugfs_create_dir("extfrag", NULL); |
1393 | if (!extfrag_debug_root) | 1361 | if (!extfrag_debug_root) |
1394 | return -ENOMEM; | 1362 | return -ENOMEM; |
1395 | 1363 | ||
1396 | if (!debugfs_create_file("unusable_index", 0444, | 1364 | if (!debugfs_create_file("unusable_index", 0444, |
1397 | extfrag_debug_root, NULL, &unusable_file_ops)) | 1365 | extfrag_debug_root, NULL, &unusable_file_ops)) |
1398 | goto fail; | 1366 | return -ENOMEM; |
1399 | 1367 | ||
1400 | if (!debugfs_create_file("extfrag_index", 0444, | 1368 | if (!debugfs_create_file("extfrag_index", 0444, |
1401 | extfrag_debug_root, NULL, &extfrag_file_ops)) | 1369 | extfrag_debug_root, NULL, &extfrag_file_ops)) |
1402 | goto fail; | 1370 | return -ENOMEM; |
1403 | 1371 | ||
1404 | return 0; | 1372 | return 0; |
1405 | fail: | ||
1406 | debugfs_remove_recursive(extfrag_debug_root); | ||
1407 | return -ENOMEM; | ||
1408 | } | 1373 | } |
1409 | 1374 | ||
1410 | module_init(extfrag_debug_init); | 1375 | module_init(extfrag_debug_init); |