Commit 7b854121eb3e5ba0241882ff939e2c485228c9c5

Authored by Lee Schermerhorn
Committed by Linus Torvalds
1 parent bbfd28eee9

Unevictable LRU Page Statistics

Report unevictable pages per zone and system wide.

Kosaki Motohiro added support for memory controller unevictable
statistics.

[riel@redhat.com: fix printk in show_free_areas()]
[akpm@linux-foundation.org: fix units in /proc/vmstats]
Signed-off-by: Lee Schermerhorn <lee.schermerhorn@hp.com>
Signed-off-by: Rik van Riel <riel@redhat.com>
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Debugged-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 5 changed files with 37 additions and 2 deletions Side-by-side Diff

... ... @@ -70,6 +70,9 @@
70 70 "Node %d Inactive(anon): %8lu kB\n"
71 71 "Node %d Active(file): %8lu kB\n"
72 72 "Node %d Inactive(file): %8lu kB\n"
  73 +#ifdef CONFIG_UNEVICTABLE_LRU
  74 + "Node %d Noreclaim: %8lu kB\n"
  75 +#endif
73 76 #ifdef CONFIG_HIGHMEM
74 77 "Node %d HighTotal: %8lu kB\n"
75 78 "Node %d HighFree: %8lu kB\n"
... ... @@ -99,6 +102,9 @@
99 102 nid, K(node_page_state(nid, NR_INACTIVE_ANON)),
100 103 nid, K(node_page_state(nid, NR_ACTIVE_FILE)),
101 104 nid, K(node_page_state(nid, NR_INACTIVE_FILE)),
  105 +#ifdef CONFIG_UNEVICTABLE_LRU
  106 + nid, K(node_page_state(nid, NR_UNEVICTABLE)),
  107 +#endif
102 108 #ifdef CONFIG_HIGHMEM
103 109 nid, K(i.totalhigh),
104 110 nid, K(i.freehigh),
... ... @@ -174,6 +174,9 @@
174 174 "Inactive(anon): %8lu kB\n"
175 175 "Active(file): %8lu kB\n"
176 176 "Inactive(file): %8lu kB\n"
  177 +#ifdef CONFIG_UNEVICTABLE_LRU
  178 + "Unevictable: %8lu kB\n"
  179 +#endif
177 180 #ifdef CONFIG_HIGHMEM
178 181 "HighTotal: %8lu kB\n"
179 182 "HighFree: %8lu kB\n"
... ... @@ -212,6 +215,9 @@
212 215 K(pages[LRU_INACTIVE_ANON]),
213 216 K(pages[LRU_ACTIVE_FILE]),
214 217 K(pages[LRU_INACTIVE_FILE]),
  218 +#ifdef CONFIG_UNEVICTABLE_LRU
  219 + K(pages[LRU_UNEVICTABLE]),
  220 +#endif
215 221 #ifdef CONFIG_HIGHMEM
216 222 K(i.totalhigh),
217 223 K(i.freehigh),
... ... @@ -1006,6 +1006,7 @@
1006 1006 {
1007 1007 unsigned long active_anon, inactive_anon;
1008 1008 unsigned long active_file, inactive_file;
  1009 + unsigned long unevictable;
1009 1010  
1010 1011 inactive_anon = mem_cgroup_get_all_zonestat(mem_cont,
1011 1012 LRU_INACTIVE_ANON);
1012 1013  
... ... @@ -1015,10 +1016,15 @@
1015 1016 LRU_INACTIVE_FILE);
1016 1017 active_file = mem_cgroup_get_all_zonestat(mem_cont,
1017 1018 LRU_ACTIVE_FILE);
  1019 + unevictable = mem_cgroup_get_all_zonestat(mem_cont,
  1020 + LRU_UNEVICTABLE);
  1021 +
1018 1022 cb->fill(cb, "active_anon", (active_anon) * PAGE_SIZE);
1019 1023 cb->fill(cb, "inactive_anon", (inactive_anon) * PAGE_SIZE);
1020 1024 cb->fill(cb, "active_file", (active_file) * PAGE_SIZE);
1021 1025 cb->fill(cb, "inactive_file", (inactive_file) * PAGE_SIZE);
  1026 + cb->fill(cb, "unevictable", unevictable * PAGE_SIZE);
  1027 +
1022 1028 }
1023 1029 return 0;
1024 1030 }
... ... @@ -1864,13 +1864,21 @@
1864 1864 }
1865 1865 }
1866 1866  
1867   - printk("Active_anon:%lu active_file:%lu inactive_anon%lu\n"
1868   - " inactive_file:%lu dirty:%lu writeback:%lu unstable:%lu\n"
  1867 + printk("Active_anon:%lu active_file:%lu inactive_anon:%lu\n"
  1868 + " inactive_file:%lu"
  1869 +//TODO: check/adjust line lengths
  1870 +#ifdef CONFIG_UNEVICTABLE_LRU
  1871 + " unevictable:%lu"
  1872 +#endif
  1873 + " dirty:%lu writeback:%lu unstable:%lu\n"
1869 1874 " free:%lu slab:%lu mapped:%lu pagetables:%lu bounce:%lu\n",
1870 1875 global_page_state(NR_ACTIVE_ANON),
1871 1876 global_page_state(NR_ACTIVE_FILE),
1872 1877 global_page_state(NR_INACTIVE_ANON),
1873 1878 global_page_state(NR_INACTIVE_FILE),
  1879 +#ifdef CONFIG_UNEVICTABLE_LRU
  1880 + global_page_state(NR_UNEVICTABLE),
  1881 +#endif
1874 1882 global_page_state(NR_FILE_DIRTY),
1875 1883 global_page_state(NR_WRITEBACK),
1876 1884 global_page_state(NR_UNSTABLE_NFS),
... ... @@ -1897,6 +1905,9 @@
1897 1905 " inactive_anon:%lukB"
1898 1906 " active_file:%lukB"
1899 1907 " inactive_file:%lukB"
  1908 +#ifdef CONFIG_UNEVICTABLE_LRU
  1909 + " unevictable:%lukB"
  1910 +#endif
1900 1911 " present:%lukB"
1901 1912 " pages_scanned:%lu"
1902 1913 " all_unreclaimable? %s"
... ... @@ -1910,6 +1921,9 @@
1910 1921 K(zone_page_state(zone, NR_INACTIVE_ANON)),
1911 1922 K(zone_page_state(zone, NR_ACTIVE_FILE)),
1912 1923 K(zone_page_state(zone, NR_INACTIVE_FILE)),
  1924 +#ifdef CONFIG_UNEVICTABLE_LRU
  1925 + K(zone_page_state(zone, NR_UNEVICTABLE)),
  1926 +#endif
1913 1927 K(zone->present_pages),
1914 1928 zone->pages_scanned,
1915 1929 (zone_is_all_unreclaimable(zone) ? "yes" : "no")
... ... @@ -623,6 +623,9 @@
623 623 "nr_active_anon",
624 624 "nr_inactive_file",
625 625 "nr_active_file",
  626 +#ifdef CONFIG_UNEVICTABLE_LRU
  627 + "nr_unevictable",
  628 +#endif
626 629 "nr_anon_pages",
627 630 "nr_mapped",
628 631 "nr_file_pages",