ANDROID: MGLRU: Avoid reactivation of anon pages on swap full

Avoid anon reclaim if swapping full since this reactivates the
pages.

Bug: 261619133
Bug: 276521916
Change-Id: Ia3af7fe8d5b29405830a812e73f95d11a0f8ee3a
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
This commit is contained in:
Kalesh Singh
2023-04-03 15:28:17 -07:00
committed by Will Deacon
parent 340c38afcd
commit b8d031e43c

View File

@@ -2957,7 +2957,8 @@ static int get_swappiness(struct lruvec *lruvec, struct scan_control *sc)
if (!sc->may_swap)
return 0;
if (!can_demote(pgdat->node_id, sc))
if (!can_demote(pgdat->node_id, sc) &&
mem_cgroup_get_nr_swap_pages(memcg) <= 0)
return 0;
return mem_cgroup_swappiness(memcg);