]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mm/memcontrol.c: fix memory.stat item ordering
authorJohannes Weiner <hannes@cmpxchg.org>
Fri, 26 Oct 2018 22:06:45 +0000 (15:06 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 26 Oct 2018 23:26:33 +0000 (16:26 -0700)
The refault stats go better with the page fault stats, and are of
higher interest than the stats on LRU operations. In fact they used to
be grouped together; when the LRU operation stats were added later on,
they were wedged in between.

Move them back together. Documentation/admin-guide/cgroup-v2.rst
already lists them in the right order.

Link: http://lkml.kernel.org/r/20181010140239.GA2527@cmpxchg.org
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/memcontrol.c

index fcec9b39e2a3f64cfbbf3d620512aa6aa4d60b30..0e9ede617b89b730d088a4670cfad9b9ad10e1dd 100644 (file)
@@ -5597,6 +5597,13 @@ static int memory_stat_show(struct seq_file *m, void *v)
        seq_printf(m, "pgfault %lu\n", acc.events[PGFAULT]);
        seq_printf(m, "pgmajfault %lu\n", acc.events[PGMAJFAULT]);
 
+       seq_printf(m, "workingset_refault %lu\n",
+                  acc.stat[WORKINGSET_REFAULT]);
+       seq_printf(m, "workingset_activate %lu\n",
+                  acc.stat[WORKINGSET_ACTIVATE]);
+       seq_printf(m, "workingset_nodereclaim %lu\n",
+                  acc.stat[WORKINGSET_NODERECLAIM]);
+
        seq_printf(m, "pgrefill %lu\n", acc.events[PGREFILL]);
        seq_printf(m, "pgscan %lu\n", acc.events[PGSCAN_KSWAPD] +
                   acc.events[PGSCAN_DIRECT]);
@@ -5607,13 +5614,6 @@ static int memory_stat_show(struct seq_file *m, void *v)
        seq_printf(m, "pglazyfree %lu\n", acc.events[PGLAZYFREE]);
        seq_printf(m, "pglazyfreed %lu\n", acc.events[PGLAZYFREED]);
 
-       seq_printf(m, "workingset_refault %lu\n",
-                  acc.stat[WORKINGSET_REFAULT]);
-       seq_printf(m, "workingset_activate %lu\n",
-                  acc.stat[WORKINGSET_ACTIVATE]);
-       seq_printf(m, "workingset_nodereclaim %lu\n",
-                  acc.stat[WORKINGSET_NODERECLAIM]);
-
        return 0;
 }