Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dev Jain <dev.jain@arm.com>
To: akpm@linux-foundation.org, chrisl@kernel.org, kasong@tencent.com,
	liam@infradead.org, ljs@kernel.org
Cc: Dev Jain <dev.jain@arm.com>,
	shikemeng@huaweicloud.com, nphamcs@gmail.com,
	baoquan.he@linux.dev, baohua@kernel.org, youngjun.park@lge.com,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	vbabka@kernel.org, jannh@google.com, pfalcato@suse.de,
	ryan.roberts@arm.com, anshuman.khandual@arm.com,
	david@kernel.org
Subject: [PATCH 2/2] mm/mprotect: drop 'sub' from batching context
Date: Tue, 23 Jun 2026 12:57:22 +0000	[thread overview]
Message-ID: <20260623125723.2503832-3-dev.jain@arm.com> (raw)
In-Reply-To: <20260623125723.2503832-1-dev.jain@arm.com>

Shorten the name of page_anon_exclusive_sub_batch by dropping the
"sub-batch" context - the function itself doesn't need this context.
Similarly, drop "sub" from sub_batch_idx, it is unnecessary and the
usage is clear enough.

Signed-off-by: Dev Jain <dev.jain@arm.com>
---
 mm/mprotect.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/mm/mprotect.c b/mm/mprotect.c
index 9cbf932b028cf..c0f5ab74bee23 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;
@@ -174,16 +174,16 @@ static __always_inline void commit_anon_folio_batch(struct vm_area_struct *vma,
 		pte_t oldpte, pte_t ptent, int nr_ptes, struct mmu_gather *tlb)
 {
 	bool expected_anon_exclusive;
-	int sub_batch_idx = 0;
+	int batch_idx = 0;
 	int len;
 
 	while (nr_ptes) {
-		expected_anon_exclusive = PageAnonExclusive(first_page + sub_batch_idx);
-		len = page_anon_exclusive_sub_batch(sub_batch_idx, nr_ptes,
+		expected_anon_exclusive = PageAnonExclusive(first_page + batch_idx);
+		len = page_anon_exclusive_batch(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);
-		sub_batch_idx += len;
+				       batch_idx, expected_anon_exclusive, tlb);
+		batch_idx += len;
 		nr_ptes -= len;
 	}
 }
-- 
2.43.0



  parent reply	other threads:[~2026-06-23 12:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-23 12:57 [PATCH 0/2] mm: drop "sub" prefix from various places Dev Jain
2026-06-23 12:57 ` [PATCH 1/2] mm/swap: rename subpage->page in folio_dup_swap/folio_put_swap Dev Jain
2026-06-23 14:28   ` Lance Yang
2026-06-23 15:38   ` Pedro Falcato
2026-06-23 16:45   ` Lorenzo Stoakes
2026-06-23 12:57 ` Dev Jain [this message]
2026-06-23 14:34   ` [PATCH 2/2] mm/mprotect: drop 'sub' from batching context Lance Yang
2026-06-23 15:37   ` Pedro Falcato
2026-06-23 16:47   ` Lorenzo Stoakes

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=20260623125723.2503832-3-dev.jain@arm.com \
    --to=dev.jain@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=anshuman.khandual@arm.com \
    --cc=baohua@kernel.org \
    --cc=baoquan.he@linux.dev \
    --cc=chrisl@kernel.org \
    --cc=david@kernel.org \
    --cc=jannh@google.com \
    --cc=kasong@tencent.com \
    --cc=liam@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=nphamcs@gmail.com \
    --cc=pfalcato@suse.de \
    --cc=ryan.roberts@arm.com \
    --cc=shikemeng@huaweicloud.com \
    --cc=vbabka@kernel.org \
    --cc=youngjun.park@lge.com \
    /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