mirror of
https://github.com/torvalds/linux.git
synced 2026-11-24 15:33:28 +00:00
Introduce pin_user_pages*() variations of get_user_pages*() calls, and
also pin_longterm_pages*() variations.
For now, these are placeholder calls, until the various call sites are
converted to use the correct get_user_pages*() or pin_user_pages*() API.
These variants will eventually all set FOLL_PIN, which is also
introduced, and thoroughly documented.
pin_user_pages()
pin_user_pages_remote()
pin_user_pages_fast()
All pages that are pinned via the above calls, must be unpinned via
put_user_page().
The underlying rules are:
* FOLL_PIN is a gup-internal flag, so the call sites should not directly
set it. That behavior is enforced with assertions.
* Call sites that want to indicate that they are going to do DirectIO
("DIO") or something with similar characteristics, should call a
get_user_pages()-like wrapper call that sets FOLL_PIN. These wrappers
will:
* Start with "pin_user_pages" instead of "get_user_pages". That
makes it easy to find and audit the call sites.
* Set FOLL_PIN
* For pages that are received via FOLL_PIN, those pages must be returned
via put_user_page().
Thanks to Jan Kara and Vlastimil Babka for explaining the 4 cases in
this documentation. (I've reworded it and expanded upon it.)
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: John Hubbard <[email protected]>
Reviewed-by: Jan Kara <[email protected]>
Reviewed-by: Mike Rapoport <[email protected]> [Documentation]
Reviewed-by: Jérôme Glisse <[email protected]>
Cc: Jonathan Corbet <[email protected]>
Cc: Ira Weiny <[email protected]>
Cc: Alex Williamson <[email protected]>
Cc: Aneesh Kumar K.V <[email protected]>
Cc: Björn Töpel <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Dan Williams <[email protected]>
Cc: Hans Verkuil <[email protected]>
Cc: Jason Gunthorpe <[email protected]>
Cc: Jason Gunthorpe <[email protected]>
Cc: Jens Axboe <[email protected]>
Cc: Kirill A. Shutemov <[email protected]>
Cc: Leon Romanovsky <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
62 lines
935 B
ReStructuredText
62 lines
935 B
ReStructuredText
======================
|
|
Core API Documentation
|
|
======================
|
|
|
|
This is the beginning of a manual for core kernel APIs. The conversion
|
|
(and writing!) of documents for this manual is much appreciated!
|
|
|
|
Core utilities
|
|
==============
|
|
|
|
.. toctree::
|
|
:maxdepth: 1
|
|
|
|
kernel-api
|
|
assoc_array
|
|
atomic_ops
|
|
cachetlb
|
|
refcount-vs-atomic
|
|
cpu_hotplug
|
|
idr
|
|
local_ops
|
|
workqueue
|
|
genericirq
|
|
xarray
|
|
librs
|
|
genalloc
|
|
errseq
|
|
packing
|
|
printk-formats
|
|
circular-buffers
|
|
generic-radix-tree
|
|
memory-allocation
|
|
mm-api
|
|
pin_user_pages
|
|
gfp_mask-from-fs-io
|
|
timekeeping
|
|
boot-time-mm
|
|
memory-hotplug
|
|
protection-keys
|
|
../RCU/index
|
|
gcc-plugins
|
|
symbol-namespaces
|
|
padata
|
|
ioctl
|
|
|
|
|
|
Interfaces for kernel debugging
|
|
===============================
|
|
|
|
.. toctree::
|
|
:maxdepth: 1
|
|
|
|
debug-objects
|
|
tracepoint
|
|
|
|
.. only:: subproject and html
|
|
|
|
Indices
|
|
=======
|
|
|
|
* :ref:`genindex`
|