linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gup: Convert FOLL_TOUCH case in follow_page_pte() to folio
@ 2024-10-02 15:13 Matthew Wilcox (Oracle)
  2024-10-08 14:12 ` David Hildenbrand
  0 siblings, 1 reply; 2+ messages in thread
From: Matthew Wilcox (Oracle) @ 2024-10-02 15:13 UTC (permalink / raw)
  To: Andrew Morton, linux-mm; +Cc: Matthew Wilcox (Oracle)

We already have the folio here, so just use it, removing three hidden
calls to compound_head().

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 mm/gup.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/mm/gup.c b/mm/gup.c
index a82890b46a36..7aecaa5ff6f3 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -922,14 +922,14 @@ static struct page *follow_page_pte(struct vm_area_struct *vma,
 	}
 	if (flags & FOLL_TOUCH) {
 		if ((flags & FOLL_WRITE) &&
-		    !pte_dirty(pte) && !PageDirty(page))
-			set_page_dirty(page);
+		    !pte_dirty(pte) && !folio_test_dirty(folio))
+			folio_mark_dirty(folio);
 		/*
 		 * pte_mkyoung() would be more correct here, but atomic care
 		 * is needed to avoid losing the dirty bit: it is easier to use
-		 * mark_page_accessed().
+		 * folio_mark_accessed().
 		 */
-		mark_page_accessed(page);
+		folio_mark_accessed(folio);
 	}
 out:
 	pte_unmap_unlock(ptep, ptl);
-- 
2.43.0



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

* Re: [PATCH] gup: Convert FOLL_TOUCH case in follow_page_pte() to folio
  2024-10-02 15:13 [PATCH] gup: Convert FOLL_TOUCH case in follow_page_pte() to folio Matthew Wilcox (Oracle)
@ 2024-10-08 14:12 ` David Hildenbrand
  0 siblings, 0 replies; 2+ messages in thread
From: David Hildenbrand @ 2024-10-08 14:12 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle), Andrew Morton, linux-mm

On 02.10.24 17:13, Matthew Wilcox (Oracle) wrote:
> We already have the folio here, so just use it, removing three hidden
> calls to compound_head().
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> ---
>   mm/gup.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/mm/gup.c b/mm/gup.c
> index a82890b46a36..7aecaa5ff6f3 100644
> --- a/mm/gup.c
> +++ b/mm/gup.c
> @@ -922,14 +922,14 @@ static struct page *follow_page_pte(struct vm_area_struct *vma,
>   	}
>   	if (flags & FOLL_TOUCH) {
>   		if ((flags & FOLL_WRITE) &&
> -		    !pte_dirty(pte) && !PageDirty(page))
> -			set_page_dirty(page);
> +		    !pte_dirty(pte) && !folio_test_dirty(folio))
> +			folio_mark_dirty(folio);
>   		/*
>   		 * pte_mkyoung() would be more correct here, but atomic care
>   		 * is needed to avoid losing the dirty bit: it is easier to use
> -		 * mark_page_accessed().
> +		 * folio_mark_accessed().
>   		 */
> -		mark_page_accessed(page);
> +		folio_mark_accessed(folio);
>   	}
>   out:
>   	pte_unmap_unlock(ptep, ptl);


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

-- 
Cheers,

David / dhildenb



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

end of thread, other threads:[~2024-10-08 14:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-02 15:13 [PATCH] gup: Convert FOLL_TOUCH case in follow_page_pte() to folio Matthew Wilcox (Oracle)
2024-10-08 14:12 ` David Hildenbrand

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