summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorSteve Sistare <steven.sistare@oracle.com>2024-10-25 16:11:51 +0300
committerJason Gunthorpe <jgg@nvidia.com>2024-10-28 19:24:23 +0300
commita2ad1b8101a36c927bcbd1317475b9576c352155 (patch)
treed2641b8751555a9f860ca974efd57fb0021d8449 /include/linux
parente2d8fe9148b79ed1cbf0663edc988db7769173dc (diff)
downloadlinux-a2ad1b8101a36c927bcbd1317475b9576c352155.tar.xz
mm/gup: Add folio_add_pins()
Export a function that adds pins to an already-pinned huge-page folio. This allows any range of small pages within the folio to be unpinned later. For example, pages pinned via memfd_pin_folios and modified by folio_add_pins could be unpinned via unpin_user_page(s). Link: https://patch.msgid.link/r/1729861919-234514-2-git-send-email-steven.sistare@oracle.com Suggested-by: Jason Gunthorpe <jgg@nvidia.com> Suggested-by: David Hildenbrand <david@redhat.com> Signed-off-by: Steve Sistare <steven.sistare@oracle.com> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Acked-by: David Hildenbrand <david@redhat.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mm.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index ecf63d2b0582..f9de33ac2add 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -2524,6 +2524,7 @@ long pin_user_pages_unlocked(unsigned long start, unsigned long nr_pages,
long memfd_pin_folios(struct file *memfd, loff_t start, loff_t end,
struct folio **folios, unsigned int max_folios,
pgoff_t *offset);
+int folio_add_pins(struct folio *folio, unsigned int pins);
int get_user_pages_fast(unsigned long start, int nr_pages,
unsigned int gup_flags, struct page **pages);