[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a2b43faf-cf33-41e5-8997-e4a0471ec3ec@linux.alibaba.com>
Date: Tue, 2 Dec 2025 13:37:59 +0800
From: Baolin Wang <baolin.wang@...ux.alibaba.com>
To: "David Hildenbrand (Red Hat)" <david@...nel.org>,
akpm@...ux-foundation.org, catalin.marinas@....com, will@...nel.org
Cc: lorenzo.stoakes@...cle.com, ryan.roberts@....com,
Liam.Howlett@...cle.com, vbabka@...e.cz, rppt@...nel.org, surenb@...gle.com,
mhocko@...e.com, riel@...riel.com, harry.yoo@...cle.com, jannh@...gle.com,
willy@...radead.org, baohua@...nel.org, linux-mm@...ck.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 0/2] support batched checks of the references for large
folios
On 2025/12/2 00:23, David Hildenbrand (Red Hat) wrote:
> On 11/25/25 01:56, Baolin Wang wrote:
>> Currently, folio_referenced_one() always checks the young flag for
>> each PTE
>> sequentially, which is inefficient for large folios. This inefficiency is
>> especially noticeable when reclaiming clean file-backed large folios,
>> where
>> folio_referenced() is observed as a significant performance hotspot.
>>
>> Moreover, on Arm architecture, which supports contiguous PTEs, there
>> is already
>> an optimization to clear the young flags for PTEs within a contiguous
>> range.
>> However, this is not sufficient. We can extend this to perform batched
>> operations
>> for the entire large folio (which might exceed the contiguous range:
>> CONT_PTE_SIZE).
>>
>> By supporting batched checking of the young flags and flushing TLB
>> entries,
>> I observed a 33% performance improvement in my file-backed folios
>> reclaim tests.
>
> Can you point at the benchmark or briefly explain what it does? What
> exactly are we measuring that improves by 33%?
Sorry for not being clear. I've described the performance test in patch
2, and I should have copied it to the cover letter:
"
Performance testing:
Allocate 10G clean file-backed folios by mmap() in a memory cgroup, and
try to reclaim 8G file-backed folios via the memory.reclaim interface. I
can observe 33% performance improvement on my Arm64 32-core server (and
10%+ improvement on my X86 machine). Meanwhile, the hotspot
folio_check_references() dropped from approximately 35% to around 5%.
W/o patchset:
real 0m1.518s
user 0m0.000s
sys 0m1.518s
W/ patchset:
real 0m1.018s
user 0m0.000s
sys 0m1.018s
"
Powered by blists - more mailing lists