linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: "Matthew Wilcox (Oracle)" <willy@infradead.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org
Subject: Re: [PATCH] gup: Convert FOLL_TOUCH case in follow_page_pte() to folio
Date: Tue, 8 Oct 2024 16:12:14 +0200	[thread overview]
Message-ID: <1390d267-9a32-4904-bca3-02814ee8e387@redhat.com> (raw)
In-Reply-To: <20241002151403.1345296-1-willy@infradead.org>

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



      reply	other threads:[~2024-10-08 14:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-02 15:13 Matthew Wilcox (Oracle)
2024-10-08 14:12 ` David Hildenbrand [this message]

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=1390d267-9a32-4904-bca3-02814ee8e387@redhat.com \
    --to=david@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=willy@infradead.org \
    /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