ANDROID: MGLRU: Avoid reactivation of anon pages on swap full
authorKalesh Singh <kaleshsingh@google.com>
Tue, 14 Feb 2023 22:17:57 +0000 (14:17 -0800)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Wed, 17 Jan 2024 17:15:54 +0000 (18:15 +0100)
commit268c1f46b2aaf95fa8501716864366b9796f0e7b
tree94fa5b1c9ba110c20b93e82f2a0b2fa0bee33d0e
parent3f3e1a95461f51b61d6c394670ca5fac4c955add
ANDROID: MGLRU: Avoid reactivation of anon pages on swap full

This is a combination of the following two commits:

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
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
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: I197513d50458f2b752957152ef67fe285c7bbaf4
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
[backport of the commit 0491ec319e940b68a1e94145a14e1c65915d7a45 from android13-5.15 branch]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
mm/vmscan.c