Re: [PATCH v2 1/3] mm/gup: introduce pin_user_page()
From: Christoph Hellwig <hch@infradead.org>
Date: 2020-08-29 14:54:41
Also in:
linux-fsdevel, linux-mm, linux-xfs, lkml
From: Christoph Hellwig <hch@infradead.org>
Date: 2020-08-29 14:54:41
Also in:
linux-fsdevel, linux-mm, linux-xfs, lkml
On Sat, Aug 29, 2020 at 01:08:51AM -0700, John Hubbard wrote:
pin_user_page() is the FOLL_PIN equivalent of get_page(). This was always a missing piece of the pin/unpin API calls (early reviewers of pin_user_pages() asked about it, in fact), but until now, it just wasn't needed. Finally though, now that the Direct IO pieces in block/bio are about to be converted to use FOLL_PIN, it turns out that there are some cases in which get_page() and get_user_pages_fast() were both used. Converting those sites requires a drop-in replacement for get_page(), which this patch supplies.
I find the name really confusing vs pin_user_pages*, as it suggests as single version of the same. It also seems partially wrong, at least in the direct I/O case as the only thing pinned here is the zero page. So maybe pin_kernel_page is a better name together with an explanation? Or just pin_page?