[PATCH v3] mm, vmscan: do not turn on cache_trim_mode if it doesn't work

From: Byungchul Park
Date: Fri Feb 23 2024 - 00:44:33 EST


Changes from v2:
1. Change the condition to stop cache_trim_mode.

From - Stop it if it's at high scan priorities, 0 or 1.
To - Stop it if it's at high scan priorities, 0 or 1, and
the mode didn't work in the previous turn.

(feedbacked by Huang Ying)

2. Change the test result in the commit message after testing
with the new logic.

Changes from v1:
1. Add a comment describing why this change is necessary in code
and rewrite the commit message with how to reproduce and what
the result is using vmstat. (feedbacked by Andrew Morton and
Yu Zhao)
2. Change the condition to avoid cache_trim_mode from
'sc->priority != 1' to 'sc->priority > 1' to reflect cases
where the priority goes to zero all the way. (feedbacked by
Yu Zhao)

--->8---