mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Garg, Shivank" <shivankg@amd.com>
To: "Salunke, Hrushikesh" <Hrushikesh.Salunke@amd.com>,
	"Rao, Bharata Bhasker" <bharata@amd.com>,
	"pfalcato@suse.de" <pfalcato@suse.de>,
	"david@kernel.org" <david@kernel.org>,
	"mhocko@suse.com" <mhocko@suse.com>,
	"surenb@google.com" <surenb@google.com>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"ankur.a.arora@oracle.com" <ankur.a.arora@oracle.com>,
	"ljs@kernel.org" <ljs@kernel.org>,
	"liam@infradead.org" <liam@infradead.org>,
	"vbabka@kernel.org" <vbabka@kernel.org>,
	"rppt@kernel.org" <rppt@kernel.org>,
	"Nayak, K Prateek" <KPrateek.Nayak@amd.com>,
	"bp@alien8.de" <bp@alien8.de>,
	"peterz@infradead.org" <peterz@infradead.org>
Cc: "linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"x86@kernel.org" <x86@kernel.org>
Subject: Re: [PATCH v3] mm/memory: drop PROCESS_PAGES_NON_PREEMPT_BATCH
Date: Tue, 10 Nov 2026 04:16:50 +0000	[thread overview]
Message-ID: <420c59779498e976307ce4591347cd75706a9964.camel@amd.com> (raw)
In-Reply-To: <b47cc8f4-3f8a-4893-8a2a-f88dd5ab762d@kernel.org>

On Mon, 2026-11-09 at 23:00 +0100, David Hildenbrand (Arm) wrote:
> On 11/9/26 20:15, Shivank Garg wrote:
> > 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@kernel.org>
> > Reviewed-by: Pedro Falcato <pfalcato@suse.de>
> > Signed-off-by: Shivank Garg <shivankg@amd.com>
> > ---
> > 
> 
> Thanks, I'll wait a bit for more review before applying.
> 
> Reviewed-by: David Hildenbrand (Arm) <david@kernel.org>


Thanks, David, for the review.

Once this is final, I'll work on the next version of the batch copy
in folio_mc_copy() [1]. :)

[1] https://lore.kernel.org/linux-mm/20261019-batpagecopy-v2-1-d75e7d0dfaae@amd.com/

Regards,
Shivank

      reply	other threads:[~2026-11-10  4:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-09 19:15 Shivank Garg
2026-11-09 22:00 ` David Hildenbrand (Arm)
2026-11-10  4:16   ` Garg, Shivank [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=420c59779498e976307ce4591347cd75706a9964.camel@amd.com \
    --to=shivankg@amd.com \
    --cc=Hrushikesh.Salunke@amd.com \
    --cc=KPrateek.Nayak@amd.com \
    --cc=akpm@linux-foundation.org \
    --cc=ankur.a.arora@oracle.com \
    --cc=bharata@amd.com \
    --cc=bp@alien8.de \
    --cc=david@kernel.org \
    --cc=liam@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=mhocko@suse.com \
    --cc=peterz@infradead.org \
    --cc=pfalcato@suse.de \
    --cc=rppt@kernel.org \
    --cc=surenb@google.com \
    --cc=vbabka@kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®