From 650081b837713d042d4d7bd6b43993ca4852d00c Mon Sep 17 00:00:00 2001 From: Kalesh Singh Date: Tue, 14 Feb 2023 14:17:57 -0800 Subject: [PATCH] ANDROID: MGLRU: Don't skip anon reclaim if swap low MGLRU tries to avoid doing unnecessary anon reclaim work if swap is low by checking if the available swap is less than the MIN_BATCH_SIZE (256kB). This can lead to unintened consequences where PSI pressure is less and LMKD doesn't wake up in time to avoid file cache thrashing. Remove this check to preserve the old bahavior. This can be improved later on once we have a low swap notification event from the kernel. Bug: 268574308 Change-Id: Id381316931a9cf6e7ea8b1ea7800c77f176c9892 Signed-off-by: Kalesh Singh --- mm/vmscan.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 564a6f279e92..95cc65d3f6b9 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -2945,8 +2945,7 @@ static int get_swappiness(struct lruvec *lruvec, struct scan_control *sc) struct mem_cgroup *memcg = lruvec_memcg(lruvec); struct pglist_data *pgdat = lruvec_pgdat(lruvec); - if (!can_demote(pgdat->node_id, sc) && - mem_cgroup_get_nr_swap_pages(memcg) < MIN_LRU_BATCH) + if (!can_demote(pgdat->node_id, sc)) return 0; return mem_cgroup_swappiness(memcg);