[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210210231519.GR4718@ziepe.ca>
Date: Wed, 10 Feb 2021 19:15:19 -0400
From: Jason Gunthorpe <jgg@...pe.ca>
To: Joao Martins <joao.m.martins@...cle.com>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
linux-rdma@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
Doug Ledford <dledford@...hat.com>,
John Hubbard <jhubbard@...dia.com>,
Matthew Wilcox <willy@...radead.org>
Subject: Re: [PATCH v3 3/4] mm/gup: add a range variant of
unpin_user_pages_dirty_lock()
On Fri, Feb 05, 2021 at 08:41:26PM +0000, Joao Martins wrote:
> Add a unpin_user_page_range_dirty_lock() API which takes a starting page
> and how many consecutive pages we want to unpin and optionally dirty.
>
> To that end, define another iterator for_each_compound_range()
> that operates in page ranges as opposed to page array.
>
> For users (like RDMA mr_dereg) where each sg represents a
> contiguous set of pages, we're able to more efficiently unpin
> pages without having to supply an array of pages much of what
> happens today with unpin_user_pages().
>
> Suggested-by: Jason Gunthorpe <jgg@...dia.com>
> Signed-off-by: Joao Martins <joao.m.martins@...cle.com>
> ---
> include/linux/mm.h | 2 ++
> mm/gup.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 64 insertions(+)
Reviewed-by: Jason Gunthorpe <jgg@...dia.com>
> +/**
> + * unpin_user_page_range_dirty_lock() - release and optionally dirty
> + * gup-pinned page range
> + *
> + * @page: the starting page of a range maybe marked dirty, and definitely released.
> + * @npages: number of consecutive pages to release.
> + * @make_dirty: whether to mark the pages dirty
> + *
> + * "gup-pinned page range" refers to a range of pages that has had one of the
> + * get_user_pages() variants called on that page.
Tidy this language though, this only works with the pin_user_pages
variants because it hardwires FOLL_PIN
Jason
Powered by blists - more mailing lists