[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7d0314fa-c7b8-0122-6efe-32ad0e48abf6@nvidia.com>
Date: Mon, 10 Jan 2022 17:14:06 -0800
From: John Hubbard <jhubbard@...dia.com>
To: "Matthew Wilcox (Oracle)" <willy@...radead.org>, linux-mm@...ck.org
Cc: Christoph Hellwig <hch@...radead.org>,
William Kucharski <william.kucharski@...cle.com>,
linux-kernel@...r.kernel.org, Jason Gunthorpe <jgg@...pe.ca>
Subject: Re: [PATCH v2 03/28] gup: Change the calling convention for
compound_range_next()
On 1/9/22 20:23, Matthew Wilcox (Oracle) wrote:
> Return the head page instead of storing it to a passed parameter.
> Pass the start page directly instead of passing a pointer to it.
>
> Signed-off-by: Matthew Wilcox (Oracle) <willy@...radead.org>
> ---
Reviewed-by: John Hubbard <jhubbard@...dia.com>
thanks,
--
John Hubbard
NVIDIA
> mm/gup.c | 11 +++++------
> 1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/mm/gup.c b/mm/gup.c
> index 86f8d843de72..3c93d2fdf4da 100644
> --- a/mm/gup.c
> +++ b/mm/gup.c
> @@ -229,21 +229,20 @@ void unpin_user_page(struct page *page)
> }
> EXPORT_SYMBOL(unpin_user_page);
>
> -static inline void compound_range_next(unsigned long i, unsigned long npages,
> - struct page **list, struct page **head,
> - unsigned int *ntails)
> +static inline struct page *compound_range_next(unsigned long i,
> + unsigned long npages, struct page *start, unsigned int *ntails)
> {
> struct page *next, *page;
> unsigned int nr = 1;
>
> - next = *list + i;
> + next = start + i;
> page = compound_head(next);
> if (PageCompound(page) && compound_order(page) >= 1)
> nr = min_t(unsigned int,
> page + compound_nr(page) - next, npages - i);
>
> - *head = page;
> *ntails = nr;
> + return page;
> }
>
> static inline void compound_next(unsigned long i, unsigned long npages,
> @@ -355,7 +354,7 @@ void unpin_user_page_range_dirty_lock(struct page *page, unsigned long npages,
> unsigned int ntails;
>
> for (index = 0; index < npages; index += ntails) {
> - compound_range_next(index, npages, &page, &head, &ntails);
> + head = compound_range_next(index, npages, page, &ntails);
> if (make_dirty && !PageDirty(head))
> set_page_dirty_lock(head);
> put_compound_head(head, ntails, FOLL_PIN);
Powered by blists - more mailing lists