mm: memcg: restore subtree stats flushing
[linux-block.git] / mm / workingset.c
index 6b9871f5a2e8b77b46321baefed66cd5d9742e71..2a2a34234df98267255f43358cca9fefba31dda7 100644 (file)
@@ -464,8 +464,12 @@ bool workingset_test_recent(void *shadow, bool file, bool *workingset)
 
        rcu_read_unlock();
 
-       /* Flush stats (and potentially sleep) outside the RCU read section */
-       mem_cgroup_flush_stats_ratelimited();
+       /*
+        * Flush stats (and potentially sleep) outside the RCU read section.
+        * XXX: With per-memcg flushing and thresholding, is ratelimiting
+        * still needed here?
+        */
+       mem_cgroup_flush_stats_ratelimited(eviction_memcg);
 
        eviction_lruvec = mem_cgroup_lruvec(eviction_memcg, pgdat);
        refault = atomic_long_read(&eviction_lruvec->nonresident_age);
@@ -676,7 +680,7 @@ static unsigned long count_shadow_nodes(struct shrinker *shrinker,
                struct lruvec *lruvec;
                int i;
 
-               mem_cgroup_flush_stats();
+               mem_cgroup_flush_stats(sc->memcg);
                lruvec = mem_cgroup_lruvec(sc->memcg, NODE_DATA(sc->nid));
                for (pages = 0, i = 0; i < NR_LRU_LISTS; i++)
                        pages += lruvec_page_state_local(lruvec,