Re: [PATCH v4 11/12] mm/mprotect: drop 'sub' from page_anon_exclusive_sub_batch

From: Dev Jain

Date: Tue Jun 23 2026 - 07:10:22 EST




On 16/06/26 7:42 pm, David Hildenbrand (Arm) wrote:
> On 5/26/26 08:36, Dev Jain wrote:
>> Shorten the function name by dropping the "sub-batch" context - the
>> function itself doesn't need this context.
>
> What about "sub_batch_idx" ?

I'll change that.

>
> This function is rather independent of the rest, so best to send that as a
> cleanup separately.

Okay.

>
>>
>> Signed-off-by: Dev Jain <dev.jain@xxxxxxx>
>> ---
>> mm/mprotect.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/mm/mprotect.c b/mm/mprotect.c
>> index 9cbf932b028cf..3357058672016 100644
>> --- a/mm/mprotect.c
>> +++ b/mm/mprotect.c
>> @@ -143,7 +143,7 @@ static __always_inline void prot_commit_flush_ptes(struct vm_area_struct *vma,
>> * !PageAnonExclusive() pages, starting from start_idx. Caller must enforce
>> * that the ptes point to consecutive pages of the same anon large folio.
>> */
>> -static __always_inline int page_anon_exclusive_sub_batch(int start_idx, int max_len,
>> +static __always_inline int page_anon_exclusive_batch(int start_idx, int max_len,
>> struct page *first_page, bool expected_anon_exclusive)
>> {
>> int idx;
>> @@ -179,7 +179,7 @@ static __always_inline void commit_anon_folio_batch(struct vm_area_struct *vma,
>>
>> while (nr_ptes) {
>> expected_anon_exclusive = PageAnonExclusive(first_page + sub_batch_idx);
>> - len = page_anon_exclusive_sub_batch(sub_batch_idx, nr_ptes,
>> + len = page_anon_exclusive_batch(sub_batch_idx, nr_ptes,
>> first_page, expected_anon_exclusive);
>> prot_commit_flush_ptes(vma, addr, ptep, oldpte, ptent, len,
>> sub_batch_idx, expected_anon_exclusive, tlb);
>
>