On Sat, 28 Jun 2025 17:04:31 +0530 Dev Jain <dev.jain@xxxxxxx> wrote:
This patchset optimizes the mprotect() system call for large foliosum what. Seems to claim that "selftests still compiles after I messed
by PTE-batching. No issues were observed with mm-selftests, build
tested on x86_64.
with stuff", which isn't very impressive ;) Please clarify?
We use the following test cases to measure performance, mprotect()'ingWell that's tasty.
the mapped memory to read-only then read-write 40 times:
Test case 1: Mapping 1G of memory, touching it to get PMD-THPs, then
pte-mapping those THPs
Test case 2: Mapping 1G of memory with 64K mTHPs
Test case 3: Mapping 1G of memory with 4K pages
Average execution time on arm64, Apple M3:
Before the patchset:
T1: 7.9 seconds T2: 7.9 seconds T3: 4.2 seconds
After the patchset:
T1: 2.1 seconds T2: 2.2 seconds T3: 4.3 seconds
Observing T1/T2 and T3 before the patchset, we also remove the regression
introduced by ptep_get() on a contpte block. And, for large folios we get
an almost 74% performance improvement, albeit the trade-off being a slight
degradation in the small folio case.