-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use pin_user_pages API for Direct I/O requests
As of kernel v5.8, pin_user_pages* interfaced were introduced. These interfaces use the FOLL_PIN flag. This is preferred interface now for Direct I/O requests in the kernel. The reasoning for using this new interface for Direct I/O requests is explained in the kernel documenetation: Documentation/core-api/pin_user_pages.rst If pin_user_pages_unlocked is available, the all Direct I/O requests will use this new API to stay uptodate with the kernel API requirements. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Brian Atkinson <[email protected]> Closes #16856
- Loading branch information
1 parent
c6442bd
commit 882a809
Showing
4 changed files
with
148 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
dnl # | ||
dnl # Check for pin_user_pages_unlocked(). | ||
dnl # | ||
AC_DEFUN([ZFS_AC_KERNEL_SRC_PIN_USER_PAGES], [ | ||
ZFS_LINUX_TEST_SRC([pin_user_pages_unlocked], [ | ||
#include <linux/mm.h> | ||
],[ | ||
unsigned long start = 0; | ||
unsigned long nr_pages = 1; | ||
struct page **pages = NULL; | ||
unsigned int gup_flags = 0; | ||
long ret __attribute__ ((unused)); | ||
ret = pin_user_pages_unlocked(start, nr_pages, pages, | ||
gup_flags); | ||
]) | ||
]) | ||
|
||
AC_DEFUN([ZFS_AC_KERNEL_PIN_USER_PAGES], [ | ||
dnl # | ||
dnl # Kernal 5.8 introduced the pin_user_pages* interfaces which should | ||
dnl # be used for Direct I/O requests. | ||
dnl # | ||
AC_MSG_CHECKING([whether pin_user_pages_unlocked() is available]) | ||
ZFS_LINUX_TEST_RESULT([pin_user_pages_unlocked], [ | ||
AC_MSG_RESULT(yes) | ||
AC_DEFINE(HAVE_PIN_USER_PAGES_UNLOCKED, 1, | ||
[pin_user_pages_unlocked() is available]) | ||
],[ | ||
AC_MSG_RESULT(no) | ||
]) | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters