Skip to content

Commit

Permalink
ANDROID: MGLRU: Don't skip anon reclaim if swap low
Browse files Browse the repository at this point in the history
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 <kaleshsingh@google.com>
Signed-off-by: Santhosh <santhosh.user.why.red@gmail.com>
  • Loading branch information
Kalesh Singh authored and user-why-red committed Jun 12, 2024
1 parent c5dd399 commit 388d308
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -2643,9 +2643,6 @@ static int get_swappiness(struct lruvec *lruvec, struct scan_control *sc)
{
struct mem_cgroup *memcg = lruvec_memcg(lruvec);

if (mem_cgroup_get_nr_swap_pages(memcg) < MIN_LRU_BATCH)
return 0;

return mem_cgroup_swappiness(memcg);
}

Expand Down

0 comments on commit 388d308

Please sign in to comment.