Message ID | 20210715055145.195411-9-ying.huang@intel.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | Migrate Pages in lieu of discard | expand |
diff --git a/mm/vmscan.c b/mm/vmscan.c index 0f9be998230f..b697f1a6108c 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -521,8 +521,13 @@ static long add_nr_deferred(long nr, struct shrinker *shrinker, static bool can_demote_anon_pages(int nid, struct scan_control *sc) { - if (sc && sc->no_demotion) - return false; + if (sc) { + if (sc->no_demotion) + return false; + /* It is pointless to do demotion in memcg reclaim */ + if (cgroup_reclaim(sc)) + return false; + } if (next_demotion_node(nid) == NUMA_NO_NODE) return false;