linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/2] mm: minor cleanups in rmap
@ 2025-04-21  8:57 Ye Liu
  2025-04-21  8:57 ` [PATCH v3 1/2] mm/rmap: rename page__anon_vma to anon_vma for consistency Ye Liu
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ye Liu @ 2025-04-21  8:57 UTC (permalink / raw)
  To: akpm, nao.horiguchi, linmiaohe
  Cc: linux-kernel, linux-mm, lorenzo.stoakes, Liam.Howlett, david,
	harry.yoo, riel, vbabka, liuye, ye.liu

From: Ye Liu <liuye@kylinos.cn>

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/20250418095600.721989-1-ye.liu@linux.dev/

Changes in v2:
- Dropped the "mm/memory-failure" patch.
- Kept only the uncontroversial rmap cleanups.
- Link to v1: https://lore.kernel.org/all/20250418075226.695014-1-ye.liu@linux.dev/

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(-)

-- 
2.25.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v3 1/2] mm/rmap: rename page__anon_vma to anon_vma for consistency
  2025-04-21  8:57 [PATCH v3 0/2] mm: minor cleanups in rmap Ye Liu
@ 2025-04-21  8:57 ` Ye Liu
  2025-04-21  8:57 ` [PATCH v3 2/2] mm/rmap: fix typo in comment in page_address_in_vma Ye Liu
  2025-04-21  9:22 ` [PATCH v3 0/2] mm: minor cleanups in rmap Harry Yoo
  2 siblings, 0 replies; 4+ messages in thread
From: Ye Liu @ 2025-04-21  8:57 UTC (permalink / raw)
  To: akpm, nao.horiguchi, linmiaohe
  Cc: linux-kernel, linux-mm, lorenzo.stoakes, Liam.Howlett, david,
	harry.yoo, riel, vbabka, liuye, ye.liu

From: Ye Liu <liuye@kylinos.cn>

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.

Signed-off-by: Ye Liu <liuye@kylinos.cn>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Acked-by: David Hildenbrand <david@redhat.com>
---
 mm/rmap.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/mm/rmap.c b/mm/rmap.c
index 67bb273dfb80..447e5b57e44f 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -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);
 }
 
-- 
2.25.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v3 2/2] mm/rmap: fix typo in comment in page_address_in_vma
  2025-04-21  8:57 [PATCH v3 0/2] mm: minor cleanups in rmap Ye Liu
  2025-04-21  8:57 ` [PATCH v3 1/2] mm/rmap: rename page__anon_vma to anon_vma for consistency Ye Liu
@ 2025-04-21  8:57 ` Ye Liu
  2025-04-21  9:22 ` [PATCH v3 0/2] mm: minor cleanups in rmap Harry Yoo
  2 siblings, 0 replies; 4+ messages in thread
From: Ye Liu @ 2025-04-21  8:57 UTC (permalink / raw)
  To: akpm, nao.horiguchi, linmiaohe
  Cc: linux-kernel, linux-mm, lorenzo.stoakes, Liam.Howlett, david,
	harry.yoo, riel, vbabka, liuye, ye.liu

From: Ye Liu <liuye@kylinos.cn>

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

Signed-off-by: Ye Liu <liuye@kylinos.cn>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
---
 mm/rmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/rmap.c b/mm/rmap.c
index 447e5b57e44f..ae4b75ce617b 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -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.
-- 
2.25.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v3 0/2] mm: minor cleanups in rmap
  2025-04-21  8:57 [PATCH v3 0/2] mm: minor cleanups in rmap Ye Liu
  2025-04-21  8:57 ` [PATCH v3 1/2] mm/rmap: rename page__anon_vma to anon_vma for consistency Ye Liu
  2025-04-21  8:57 ` [PATCH v3 2/2] mm/rmap: fix typo in comment in page_address_in_vma Ye Liu
@ 2025-04-21  9:22 ` Harry Yoo
  2 siblings, 0 replies; 4+ messages in thread
From: Harry Yoo @ 2025-04-21  9:22 UTC (permalink / raw)
  To: Ye Liu
  Cc: akpm, nao.horiguchi, linmiaohe, linux-kernel, linux-mm,
	lorenzo.stoakes, Liam.Howlett, david, riel, vbabka, liuye

On Mon, Apr 21, 2025 at 04:57:27PM +0800, Ye Liu wrote:
> From: Ye Liu <liuye@kylinos.cn>
> 
> 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/20250418095600.721989-1-ye.liu@linux.dev/
> 
> Changes in v2:
> - Dropped the "mm/memory-failure" patch.
> - Kept only the uncontroversial rmap cleanups.
> - Link to v1: https://lore.kernel.org/all/20250418075226.695014-1-ye.liu@linux.dev/
> 
> 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,
Reviewed-by: Harry Yoo <harry.yoo@oracle.com>

Thanks!

-- 
Cheers,
Harry / Hyeonggon


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-04-21  9:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-21  8:57 [PATCH v3 0/2] mm: minor cleanups in rmap Ye Liu
2025-04-21  8:57 ` [PATCH v3 1/2] mm/rmap: rename page__anon_vma to anon_vma for consistency Ye Liu
2025-04-21  8:57 ` [PATCH v3 2/2] mm/rmap: fix typo in comment in page_address_in_vma Ye Liu
2025-04-21  9:22 ` [PATCH v3 0/2] mm: minor cleanups in rmap Harry Yoo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox