Re: [PATCH v2] mm/memory: drop PROCESS_PAGES_NON_PREEMPT_BATCH
From: Garg, Shivank
Date: Mon Nov 09 2026 - 05:29:10 EST
On Mon, 2026-11-09 at 10:12 +0000, Pedro Falcato wrote:
> >
> > No functional change intended.
> >
> > Suggested-by: David Hildenbrand <david@xxxxxxxxxx>
> > Signed-off-by: Shivank Garg <shivankg@xxxxxxx>
>
> Reviewed-by: Pedro Falcato <pfalcato@xxxxxxx>
>
> with a question below.
>
> > ---
> > This came up in review of the copy_mc_highpages() series [1]. Pedro
> > pointed out that most architecture run with full or lazy preempt, so mm
> > does not need to check the preemption model at runtime or batch the copy
> >
> > -
> > - might_sleep();
> > + if (IS_ENABLED(CONFIG_PREEMPTION)) {
> > + clear_user_highpages(page, addr, nr_pages);
> > + return;
> > + }
> >
> > - for (i = 0; i < nr_pages; i += count) {
> > + for (i = 0; i < nr_pages; i++) {
> > cond_resched();
> > -
> > - count = min(unit, nr_pages - i);
> > - clear_user_highpages(page + i, addr + i * PAGE_SIZE, count);
> > + clear_user_highpages(page + i, addr + i * PAGE_SIZE, 1);
>
> I think we can use clear_user_highpage() here. I don't know if that's
> necessarily desirable, but it would make this a little simpler.
>
Sure, this makes sense. Will do this in next version.
Thanks,
Shivank