Skip to contentSkip to conversation

mm: minor cleanups in rmap

PATCH Applied Ye Liu 2 participants 4 messages Apr 21, 2025

Subsystems (2)
lore
Share & tools
lore

Ye Liu

author
#0 lore raw

v3 cover mm: minor cleanups in rmap

From: Ye Liu <[email protected]>

Minor cleanups in mm/rmap.c:

- Rename a local variable for consistency
- Fix a typo in a comment

No functional changes.

Changes in v3:
- Rename variable from page_anon_vma to anon_vma.
- Link to v2: https://lore.kernel.org/all/[email protected]/

Changes in v2:
- Dropped the "mm/memory-failure" patch.
- Kept only the uncontroversial rmap cleanups.
- Link to v1: https://lore.kernel.org/all/[email protected]/

Ye Liu (2):
mm/rmap: rename page__anon_vma to anon_vma for consistency mm/rmap: fix typo in comment in page_address_in_vma

 mm/rmap.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
Signature · 1 line
2.25.1
author
#1 lore raw

PATCH v3 1/2 mm/rmap: rename page__anon_vma to anon_vma for consistency

From: Ye Liu <[email protected]>

Renamed local variable page__anon_vma in page_address_in_vma() to anon_vma. The previous naming convention of using double underscores (__) is unnecessary and inconsistent with typical kernel style, which uses single underscores to denote local variables. Also updated comments to reflect the new variable name.

Functionality unchanged.

---
 mm/rmap.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
mm/rmap.c +4 -4
index 67bb273dfb80..447e5b57e44f 100644
@@ -789,13 +789,13 @@ unsigned long page_address_in_vma(const struct folio *folio,
 		const struct page *page, const struct vm_area_struct *vma)
 {
 	if (folio_test_anon(folio)) {
-		struct anon_vma *page__anon_vma = folio_anon_vma(folio);
+		struct anon_vma *anon_vma = folio_anon_vma(folio);
 		/*
 		 * Note: swapoff's unuse_vma() is more efficient with this
 		 * check, and needs it to match anon_vma when KSM is active.
 		 */
-		if (!vma->anon_vma || !page__anon_vma ||
-		    vma->anon_vma->root != page__anon_vma->root)
+		if (!vma->anon_vma || !anon_vma ||
+		    vma->anon_vma->root != anon_vma->root)
 			return -EFAULT;
 	} else if (!vma->vm_file) {
 		return -EFAULT;
@@ -803,7 +803,7 @@ unsigned long page_address_in_vma(const struct folio *folio,
 		return -EFAULT;
 	}
 
-	/* KSM folios don't reach here because of the !page__anon_vma check */
+	/* KSM folios don't reach here because of the !anon_vma check */
 	return vma_address(vma, page_pgoff(folio, page), 1);
 }
 
Signature · 1 line
2.25.1
author
#2 lore raw

PATCH v3 2/2 mm/rmap: fix typo in comment in page_address_in_vma

In reply to Ye Liu

From: Ye Liu <[email protected]>

Fixes a minor typo in the comment above page_address_in_vma():
"responsibililty" → "responsibility"

---
 mm/rmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/rmap.c +1 -1
index 447e5b57e44f..ae4b75ce617b 100644
@@ -774,7 +774,7 @@ static bool should_defer_flush(struct mm_struct *mm, enum ttu_flags flags)
  * @vma: The VMA we need to know the address in.
  *
  * Calculates the user virtual address of this page in the specified VMA.
- * It is the caller's responsibililty to check the page is actually
+ * It is the caller's responsibility to check the page is actually
  * within the VMA.  There may not currently be a PTE pointing at this
  * page, but if a page fault occurs at this address, this is the page
  * which will be accessed.
Signature · 1 line
2.25.1
Reviewed-by on the v3 series
#3 lore raw
In reply to Ye Liu
Quoted 18 lines · Ye Liu

From: Ye Liu <[email protected]>

Minor cleanups in mm/rmap.c:

- Rename a local variable for consistency
- Fix a typo in a comment

No functional changes.

Changes in v3:
- Rename variable from page_anon_vma to anon_vma.
- Link to v2: https://lore.kernel.org/all/[email protected]/

Changes in v2:
- Dropped the "mm/memory-failure" patch.
- Kept only the uncontroversial rmap cleanups.
- Link to v1: https://lore.kernel.org/all/[email protected]/

Quoted 8 lines

Ye Liu (2):
mm/rmap: rename page__anon_vma to anon_vma for consistency mm/rmap: fix typo in comment in page_address_in_vma

 mm/rmap.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

For the series:

LGTM,

Thanks!

Signature · 2 lines
Cheers,
Harry / Hyeonggon