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.
Showing the changes to include/uapi/linux (1 of 1 file). Show all
Unified · Split
| @@ -21,7 +21,8 @@ · 20 unmodified lines | ||
| 21 | 21 | #define UFFD_API_FEATURES (UFFD_FEATURE_EVENT_FORK | \ |
| 22 | 22 | UFFD_FEATURE_EVENT_REMAP | \ |
| 23 | 23 | UFFD_FEATURE_EVENT_MADVDONTNEED | \ |
| 24 | − UFFD_FEATURE_MISSING_HUGETLBFS) | |
| 24 | + UFFD_FEATURE_MISSING_HUGETLBFS | \ | |
| 25 | + UFFD_FEATURE_MISSING_SHMEM) | |
| 25 | 26 | #define UFFD_API_IOCTLS \ |
| 26 | 27 | ((__u64)1 << _UFFDIO_REGISTER | \ |
| 27 | 28 | (__u64)1 << _UFFDIO_UNREGISTER | \ |
| @@ -146,12 +147,17 @@ struct uffdio_api { · 118 unmodified lines | ||
| 146 | 147 | * it, so userland can later check if the feature flag is |
| 147 | 148 | * present in uffdio_api.features after UFFDIO_API |
| 148 | 149 | * 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). | |
| 149 | 154 | */ |
| 150 | 155 | #define UFFD_FEATURE_PAGEFAULT_FLAG_WP (1<<0) |
| 151 | 156 | #define UFFD_FEATURE_EVENT_FORK (1<<1) |
| 152 | 157 | #define UFFD_FEATURE_EVENT_REMAP (1<<2) |
| 153 | 158 | #define UFFD_FEATURE_EVENT_MADVDONTNEED (1<<3) |
| 154 | 159 | #define UFFD_FEATURE_MISSING_HUGETLBFS (1<<4) |
| 160 | +#define UFFD_FEATURE_MISSING_SHMEM (1<<5) | |
| 155 | 161 | __u64 features; |
| 156 | 162 | |
| 157 | 163 | __u64 ioctls; |