ioctl_pagemap_scan(2) | System Calls Manual | ioctl_pagemap_scan(2) |
ioctl_pagemap_scan - get and/or clear page flags
Standard C library (libc, -lc)
#include <linux/fs.h> /* Definition of struct pm_scan_arg, struct page_region, and PAGE_IS_* constants */ #include <sys/ioctl.h>
int ioctl(int pagemap_fd, PAGEMAP_SCAN, struct pm_scan_arg *arg);
This ioctl(2) is used to get and optionally clear some specific flags from page table entries. The information is returned with PAGE_SIZE granularity.
To start tracking the written state (flag) of a page or range of memory, the UFFD_FEATURE_WP_ASYNC must be enabled by UFFDIO_API ioctl(2) on userfaultfd and memory range must be registered with UFFDIO_REGISTER ioctl(2) in UFFDIO_REGISTER_MODE_WP mode.
The following page table entry flags are supported:
The get operation is always performed if the output buffer is specified. The other operations are as following:
struct pm_scan_arg { __u64 size; __u64 flags; __u64 start; __u64 end; __u64 walk_end; __u64 vec; __u64 vec_len; __u64 max_pages __u64 category_inverted; __u64 category_mask; __u64 category_anyof_mask __u64 return_mask; };
struct page_region { __u64 start; __u64 end; __u64 categories; };
On error, -1 is returned, and errno is set to indicate the error.
Error codes can be one of, but are not limited to, the following:
Linux.
Linux 6.7.
ioctl(2)
2024-01-28 | Linux man-pages 6.7 |