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

BACKPORT: mm/mglru: fix PTE-mapped large folios

Count the accessed bits from PTEs mapping the same large folio as one
access rather than multiple accesses.

The last patch changed how folios accessed through page tables are
promoted: rather than getting promoted after the accessed bit is cleared
for the first time, a folio only gets promoted thereafter.  Counting the
accessed bits from the same large folio as multiple accesses can cause
that folio to be promoted prematurely, which in turn can cause
overprotection of single-use large folios.

This patch reduced the sys time of the kernel compilation by 95% CI [2,
5]% on Altra M128-30 with 3GB DRAM, 12GB zram, 16KB THPs and -j32.

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


Signed-off-by: default avatarYu Zhao <yuzhao@google.com>
Reported-by: default avatarBarry Song <v-songbaohua@oppo.com>
Tested-by: default avatarKalesh Singh <kaleshsingh@google.com>
Cc: Bharata B Rao <bharata@amd.com>
Cc: David Stevens <stevensd@chromium.org>
Cc: Kairui Song <kasong@tencent.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
(cherry picked from commit a52dcec5)
Bug: 393446550
[ Fix trivial conflicts lru_gen_look_around() and walk_pte_range().
  - Kalesh Singh ]
Signed-off-by: default avatarKalesh Singh <kaleshsingh@google.com>
Change-Id: I47fcf8522a6a8c683b1a26bf014d4e3083f17411
parent 3eafc3b0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment