Re: [PATCH v3] mm/memory: drop PROCESS_PAGES_NON_PREEMPT_BATCH
From: David Hildenbrand (Arm)
Date: Mon Nov 16 2026 - 10:22:48 EST
On 11/16/26 06:18, Ankur Arora wrote:
>
> Shivank Garg <shivankg@xxxxxxx> writes:
>
>> This Message Is From an External Sender
>> This message came from outside your organization.
>> Report Suspicious
>>
>> clear_contig_highpages() clears the whole range at once under
>> preemptible models. Otherwise it clears PROCESS_PAGES_NON_PREEMPT_BATCH
>> pages at a time, with a cond_resched() in between. The batch is 32MB if
>> the architecture defines clear_pages(), and one page otherwise.
>>
>> Since commit 7dadeaa6e851 ("sched: Further restrict the preemption
>> modes"), architectures that support lazy preemption only offer the
>> full, lazy and RT preemption models, also with PREEMPT_DYNAMIC. x86 is
>> one of them, and it is the only architecture that defines
>> clear_pages(). So the 32MB batch is never used: whenever
>> clear_contig_highpages() runs under a cooperative model, the batch is
>> one page.
>>
>> Make that explicit. Clear the whole range when CONFIG_PREEMPTION is
>> set, and one page at a time with cond_resched() in between otherwise.
>> Drop PROCESS_PAGES_NON_PREEMPT_BATCH, which has no other users.
>>
>> PREEMPT_DYNAMIC kernels also have CONFIG_PREEMPTION set, and
>> cond_resched() does nothing on any of these kernels. So a build-time
>> CONFIG_PREEMPTION check is enough, and preempt_model_preemptible() is
>> not needed.
>>
>> No functional change intended.
>>
>> Suggested-by: David Hildenbrand <david@xxxxxxxxxx>
>> Reviewed-by: Pedro Falcato <pfalcato@xxxxxxx>
>> Signed-off-by: Shivank Garg <shivankg@xxxxxxx>
>
> Am a bit late to this.
>
> Reviewed-by: Ankur Arora <ankur.a.arora@xxxxxxxxxx>
No worries, added it :)
--
Cheers,
David