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:Yu Zhao <yuzhao@google.com> Reported-by:
Barry Song <v-songbaohua@oppo.com> Tested-by:
Kalesh 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:
Andrew 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:
Kalesh Singh <kaleshsingh@google.com> Change-Id: I47fcf8522a6a8c683b1a26bf014d4e3083f17411
Loading
Please sign in to comment