Commit a3202235 authored by Yu Zhao's avatar Yu Zhao Committed by Carlos Llamas
Browse files

UPSTREAM: mm/mglru: rework type selection

With anon and file min_seq being able to move independently, rework type
selection so that it is based on the total refaults from all tiers of each
type.  Also allow a type to be selected until that type reaches
MIN_NR_GENS, regardless of whether that type has a larger min_seq or not,
to accommodate extreme swappiness.

Since some tiers of a selected type can have higher refaults than the
first tier of the other type, use a less larger gain factor 2:3 instead of
1:2, in order for those tiers in the selected type to be better protected.

As an intermediate step to the final optimization, this change by itself
should not have userspace-visiable effects beyond performance.

Link: https://lkml.kernel.org/r/20241231043538.4075764-5-yuzhao@google.com


Signed-off-by: default avatarYu Zhao <yuzhao@google.com>
Reported-by: default avatarDavid Stevens <stevensd@chromium.org>
Tested-by: default avatarKalesh Singh <kaleshsingh@google.com>
Cc: Barry Song <v-songbaohua@oppo.com>
Cc: Bharata B Rao <bharata@amd.com>
Cc: Kairui Song <kasong@tencent.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
(cherry picked from commit 37a26087)
Bug: 393446550
Signed-off-by: default avatarKalesh Singh <kaleshsingh@google.com>
Change-Id: Id26fa4191c9879b1170e09dfd41525fb66c219d1
parent 280b18e6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment