History

userfaultfd: hugetlbfs: UFFD_FEATURE_MISSING_SHMEM

Userland developers asked to be notified immediately by the UFFDIO_API ioctl if shmem missing mode is supported by userfaultfd in the running kernel. This avoids the need to run UFFDIO_REGISTER on a shmem virtual memory range to find out.

Andrea Arcangeli committed 9 years ago

Commit 47dd9241 parent cb658a41 file · +7 −1Browse files

Showing the changes to include/uapi/linux (1 of 1 file). Show all

Unified · Split

include/uapi/linux/userfaultfd.h+7−1
@@ -21,7 +21,8 @@ · 20 unmodified lines
2121 #define UFFD_API_FEATURES (UFFD_FEATURE_EVENT_FORK | \
2222 UFFD_FEATURE_EVENT_REMAP | \
2323 UFFD_FEATURE_EVENT_MADVDONTNEED | \
24− UFFD_FEATURE_MISSING_HUGETLBFS)
24+ UFFD_FEATURE_MISSING_HUGETLBFS | \
25+ UFFD_FEATURE_MISSING_SHMEM)
2526 #define UFFD_API_IOCTLS \
2627 ((__u64)1 << _UFFDIO_REGISTER | \
2728 (__u64)1 << _UFFDIO_UNREGISTER | \
@@ -146,12 +147,17 @@ struct uffdio_api { · 118 unmodified lines
146147 * it, so userland can later check if the feature flag is
147148 * present in uffdio_api.features after UFFDIO_API
148149 * succeeded.
150+ *
151+ * UFFD_FEATURE_MISSING_SHMEM works the same as
152+ * UFFD_FEATURE_MISSING_HUGETLBFS, but it applies to shmem
153+ * (i.e. tmpfs and other shmem based APIs).
149154 */
150155 #define UFFD_FEATURE_PAGEFAULT_FLAG_WP (1<<0)
151156 #define UFFD_FEATURE_EVENT_FORK (1<<1)
152157 #define UFFD_FEATURE_EVENT_REMAP (1<<2)
153158 #define UFFD_FEATURE_EVENT_MADVDONTNEED (1<<3)
154159 #define UFFD_FEATURE_MISSING_HUGETLBFS (1<<4)
160+#define UFFD_FEATURE_MISSING_SHMEM (1<<5)
155161 __u64 features;
156162
157163 __u64 ioctls;