All of lore.kernel.org
 help / color / mirror / Atom feed
From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Rik van Riel <riel@surriel.com>, linux-kernel@vger.kernel.org
Cc: linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>,
	Suren Baghdasaryan <surenb@google.com>,
	Lorenzo Stoakes <ljs@kernel.org>,
	Christoph Hellwig <hch@infradead.org>,
	Yuan-Hao Hsu <aa9736195201@gmail.com>,
	John Hubbard <jhubbard@nvidia.com>,
	Jason Gunthorpe <jgg@ziepe.ca>, Peter Xu <peterx@redhat.com>
Subject: Re: [PATCH 2/9] mm/gup: break out gup_flush_pages() helper
Date: Thu, 26 Nov 2026 14:41:59 +0100	[thread overview]
Message-ID: <4fc1e334-16c8-440f-aa83-ae27f8b8d3d8@kernel.org> (raw)
In-Reply-To: <20261123195609.4115244-3-riel@surriel.com>

On 11/23/26 20:56, Rik van Riel wrote:
> __get_user_pages() flushes each page's caches in an open-coded loop
> right after filling the array.
> 
> Move it into a gup_flush_pages() helper.
> 
> No functional changes intended.
> 
> Suggested-by: David Hildenbrand <david@kernel.org>
> Signed-off-by: Rik van Riel <riel@surriel.com>
> ---
>  mm/gup.c | 27 +++++++++++++++++++--------
>  1 file changed, 19 insertions(+), 8 deletions(-)
> 
> diff --git a/mm/gup.c b/mm/gup.c
> index e0698d2075b4..d35fedbce7e1 100644
> --- a/mm/gup.c
> +++ b/mm/gup.c
> @@ -729,6 +729,24 @@ static void gup_fill_pages(struct page **pages, struct page *page,
>  		pages[i] = page + i;
>  }
>  
> +/*
> + * Flush the caches for @nr_pages pages stored in @pages. The caller
> + * already holds folio references on the pages.
> + */

Again, drop all of these function comments.

> +static void gup_flush_pages(struct vm_area_struct *vma, unsigned long address,
> +		struct page **pages, unsigned long nr_pages)
> +{
> +	unsigned long i;
> +
> +	if (!pages)
> +		return;


Will this ever be called in this series on !pages?

If not, remove it.

Reviewed-by: David Hildenbrand (Arm) <david@kernel.org>


-- 
Cheers,

David


  reply	other threads:[~2026-11-26 13:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23 19:56 [PATCH v6 0/9] mm/gup: walk and batch whole PTE tables in slow GUP Rik van Riel
2026-11-23 19:56 ` [PATCH 1/9] mm/gup: break out gup_fill_pages() helper Rik van Riel
2026-11-26 13:40   ` David Hildenbrand (Arm)
2026-11-23 19:56 ` [PATCH 2/9] mm/gup: break out gup_flush_pages() helper Rik van Riel
2026-11-26 13:41   ` David Hildenbrand (Arm) [this message]
2026-11-26 17:41     ` Rik van Riel
2026-11-23 19:56 ` [PATCH 3/9] mm/gup: convert follow_page_mask() to return a long Rik van Riel
2026-11-26 14:04   ` David Hildenbrand (Arm)
2026-11-23 19:56 ` [PATCH 4/9] mm/gup: split out folio grab-and-store helper Rik van Riel
2026-11-23 19:56 ` [PATCH 5/9] mm/gup: break out gup_lookup_pte() helper Rik van Riel
2026-11-23 19:56 ` [PATCH 6/9] mm/gup: return a huge page's full count from follow_page_mask() Rik van Riel
2026-11-23 19:56 ` [PATCH 7/9] mm/gup: walk multiple PTEs per follow_page_pte() call Rik van Riel
2026-11-23 19:56 ` [PATCH 8/9] mm/gup: batch contiguous same-folio PTEs into one refcount grab Rik van Riel
2026-11-23 19:56 ` [PATCH 9/9] mm/gup: unshare-check every page of a pte batch Rik van Riel
2026-11-26 13:50   ` David Hildenbrand (Arm)
2026-11-26 17:37     ` Rik van Riel

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=4fc1e334-16c8-440f-aa83-ae27f8b8d3d8@kernel.org \
    --to=david@kernel.org \
    --cc=aa9736195201@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=hch@infradead.org \
    --cc=jgg@ziepe.ca \
    --cc=jhubbard@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=peterx@redhat.com \
    --cc=riel@surriel.com \
    --cc=surenb@google.com \
    /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 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.