mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-08-03 23:33:01 +00:00
kerndat: check support for PAGE_IS_SOFT_DIRTY
The commit introducing PAGE_IS_SOFT_DIRTY has not been merged
in kernel v6.7.x.
fs/proc/task_mmu: report SOFT_DIRTY bits through the PAGEMAP_SCAN ioctl
e6a9a2cbc1
As a result, CRIU fails with the following error:
Error (criu/pagemap-cache.c:199): pagemap-cache: PAGEMAP_SCAN: Invalid argument'
Error (criu/pagemap-cache.c:225): pagemap-cache: Failed to fill cache for 63 (400000-402000)'
This patch updates check_pagemap() in kerndat to check if PAGE_IS_SOFT_DIRTY is supported.
Fixes: #2334
Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
This commit is contained in:
parent
6d37f9a4df
commit
7bd786d0d4
1 changed files with 11 additions and 7 deletions
|
|
@ -63,6 +63,14 @@ static int check_pagemap(void)
|
|||
{
|
||||
int ret, fd, retry;
|
||||
u64 pfn = 0;
|
||||
struct pm_scan_arg args = {
|
||||
.size = sizeof(struct pm_scan_arg),
|
||||
.flags = 0,
|
||||
.category_inverted = PAGE_IS_PFNZERO | PAGE_IS_FILE,
|
||||
.category_mask = PAGE_IS_PFNZERO | PAGE_IS_FILE,
|
||||
.category_anyof_mask = PAGE_IS_PRESENT | PAGE_IS_SWAPPED,
|
||||
.return_mask = PAGE_IS_PRESENT | PAGE_IS_SWAPPED | PAGE_IS_SOFT_DIRTY,
|
||||
};
|
||||
|
||||
fd = __open_proc(PROC_SELF, EPERM, O_RDONLY, "pagemap");
|
||||
if (fd < 0) {
|
||||
|
|
@ -75,15 +83,11 @@ static int check_pagemap(void)
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (ioctl(fd, PAGEMAP_SCAN, NULL) == 0) {
|
||||
pr_err("PAGEMAP_SCAN succeeded unexpectedly\n");
|
||||
return -1;
|
||||
if (ioctl(fd, PAGEMAP_SCAN, &args) == 0) {
|
||||
pr_debug("PAGEMAP_SCAN is supported\n");
|
||||
kdat.has_pagemap_scan = true;
|
||||
} else {
|
||||
switch (errno) {
|
||||
case EFAULT:
|
||||
pr_debug("PAGEMAP_SCAN is supported\n");
|
||||
kdat.has_pagemap_scan = true;
|
||||
break;
|
||||
case EINVAL:
|
||||
case ENOTTY:
|
||||
pr_debug("PAGEMAP_SCAN isn't supported\n");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue