All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm/huge_memory: use RMAP_NONE when calling page_add_anon_rmap()
@ 2023-07-13 12:05 Miaohe Lin
  2023-07-13 12:12 ` Matthew Wilcox
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Miaohe Lin @ 2023-07-13 12:05 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, linux-kernel, linmiaohe

It's more convenient and readable to use RMAP_NONE instead of false when
calling page_add_anon_rmap(). No functional change intended.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 mm/huge_memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 9f3109ed7351..762be2f4244c 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -2255,7 +2255,7 @@ static void __split_huge_pmd_locked(struct vm_area_struct *vma, pmd_t *pmd,
 				entry = pte_mksoft_dirty(entry);
 			if (uffd_wp)
 				entry = pte_mkuffd_wp(entry);
-			page_add_anon_rmap(page + i, vma, addr, false);
+			page_add_anon_rmap(page + i, vma, addr, RMAP_NONE);
 		}
 		VM_BUG_ON(!pte_none(ptep_get(pte)));
 		set_pte_at(mm, addr, pte, entry);
-- 
2.33.0


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

* Re: [PATCH] mm/huge_memory: use RMAP_NONE when calling page_add_anon_rmap()
  2023-07-13 12:05 [PATCH] mm/huge_memory: use RMAP_NONE when calling page_add_anon_rmap() Miaohe Lin
@ 2023-07-13 12:12 ` Matthew Wilcox
  2023-07-14  3:28 ` Anshuman Khandual
  2023-07-14 14:24 ` David Hildenbrand
  2 siblings, 0 replies; 4+ messages in thread
From: Matthew Wilcox @ 2023-07-13 12:12 UTC (permalink / raw)
  To: Miaohe Lin; +Cc: akpm, linux-mm, linux-kernel

On Thu, Jul 13, 2023 at 08:05:57PM +0800, Miaohe Lin wrote:
> It's more convenient and readable to use RMAP_NONE instead of false when
> calling page_add_anon_rmap(). No functional change intended.
> 
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>

Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>

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

* Re: [PATCH] mm/huge_memory: use RMAP_NONE when calling page_add_anon_rmap()
  2023-07-13 12:05 [PATCH] mm/huge_memory: use RMAP_NONE when calling page_add_anon_rmap() Miaohe Lin
  2023-07-13 12:12 ` Matthew Wilcox
@ 2023-07-14  3:28 ` Anshuman Khandual
  2023-07-14 14:24 ` David Hildenbrand
  2 siblings, 0 replies; 4+ messages in thread
From: Anshuman Khandual @ 2023-07-14  3:28 UTC (permalink / raw)
  To: Miaohe Lin, akpm; +Cc: linux-mm, linux-kernel



On 7/13/23 17:35, Miaohe Lin wrote:
> It's more convenient and readable to use RMAP_NONE instead of false when
> calling page_add_anon_rmap(). No functional change intended.

It's not only more convenient, page_add_anon_rmap() also expects rmap_t
as the last argument.

> 
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> ---
>  mm/huge_memory.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/huge_memory.c b/mm/huge_memory.c
> index 9f3109ed7351..762be2f4244c 100644
> --- a/mm/huge_memory.c
> +++ b/mm/huge_memory.c
> @@ -2255,7 +2255,7 @@ static void __split_huge_pmd_locked(struct vm_area_struct *vma, pmd_t *pmd,
>  				entry = pte_mksoft_dirty(entry);
>  			if (uffd_wp)
>  				entry = pte_mkuffd_wp(entry);
> -			page_add_anon_rmap(page + i, vma, addr, false);
> +			page_add_anon_rmap(page + i, vma, addr, RMAP_NONE);
>  		}
>  		VM_BUG_ON(!pte_none(ptep_get(pte)));
>  		set_pte_at(mm, addr, pte, entry);

After this change, no other page_add_anon_rmap() call site has non rmap_t
argument.

Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>

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

* Re: [PATCH] mm/huge_memory: use RMAP_NONE when calling page_add_anon_rmap()
  2023-07-13 12:05 [PATCH] mm/huge_memory: use RMAP_NONE when calling page_add_anon_rmap() Miaohe Lin
  2023-07-13 12:12 ` Matthew Wilcox
  2023-07-14  3:28 ` Anshuman Khandual
@ 2023-07-14 14:24 ` David Hildenbrand
  2 siblings, 0 replies; 4+ messages in thread
From: David Hildenbrand @ 2023-07-14 14:24 UTC (permalink / raw)
  To: Miaohe Lin, akpm; +Cc: linux-mm, linux-kernel

On 13.07.23 14:05, Miaohe Lin wrote:
> It's more convenient and readable to use RMAP_NONE instead of false when
> calling page_add_anon_rmap(). No functional change intended.
> 
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> ---
>   mm/huge_memory.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/huge_memory.c b/mm/huge_memory.c
> index 9f3109ed7351..762be2f4244c 100644
> --- a/mm/huge_memory.c
> +++ b/mm/huge_memory.c
> @@ -2255,7 +2255,7 @@ static void __split_huge_pmd_locked(struct vm_area_struct *vma, pmd_t *pmd,
>   				entry = pte_mksoft_dirty(entry);
>   			if (uffd_wp)
>   				entry = pte_mkuffd_wp(entry);
> -			page_add_anon_rmap(page + i, vma, addr, false);
> +			page_add_anon_rmap(page + i, vma, addr, RMAP_NONE);
>   		}
>   		VM_BUG_ON(!pte_none(ptep_get(pte)));
>   		set_pte_at(mm, addr, pte, entry);

Indeed

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 
Cheers,

David / dhildenb


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

end of thread, other threads:[~2023-07-14 14:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-13 12:05 [PATCH] mm/huge_memory: use RMAP_NONE when calling page_add_anon_rmap() Miaohe Lin
2023-07-13 12:12 ` Matthew Wilcox
2023-07-14  3:28 ` Anshuman Khandual
2023-07-14 14:24 ` David Hildenbrand

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.