Skip to content

fs/proc: extend the PAGEMAP_SCAN ioctl to report guard regions

Andrei Vagin criu linux-doc linux-fsdevel linux-mm lkml 2 versions – Applied

Status from this message: [merged mm-stable] selftests-mm-add-pagemap_scan-guard-region-test.patch removed from -mm tree

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 4 repliesApplied 3/3
  2. v12 patches 6 repliesSuperseded

Changes in v2 from the cover letter

- sync linux/fs.h with the kernel sources
- address comments from Lorenzo and David.

Patches in v2 All 3 applied

#Subject and filesSizeRepliesApplied
1/3fs/proc: extend the PAGEMAP_SCAN ioctl to report guard regionsDocumentation/admin-guide/mm/pagemap.rst fs/proc/task_mmu.c include/uapi/linux/fs.h+12 -70 repliesApplied
2/3tools headers UAPI: Sync linux/fs.h with the kernel sourcestools/include/uapi/linux/fs.h+18 -11 replyApplied
3/3selftests/mm: add PAGEMAP_SCAN guard region testtools/testing/selftests/mm/guard-regions.c+57 -01 replyApplied

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchDavid HildenbrandLorenzo Stoakes
1/3A-b R-b
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH 0/3 v2] fs/proc: extend the PAGEMAP_SCAN ioctl to report guard regions

Introduce the PAGE_IS_GUARD flag in the PAGEMAP_SCAN ioctl to expose information about guard regions. This allows userspace tools, such as CRIU, to detect and handle guard regions.

Currently, CRIU utilizes PAGEMAP_SCAN as a more efficient alternative to parsing /proc/pid/pagemap. Without this change, guard regions are incorrectly reported as swap-anon regions, leading CRIU to attempt dumping them and subsequently failing.

This series should be applied on top of "[PATCH 0/2] fs/proc/task_mmu:
add guard region bit to pagemap":
https://lore.kernel.org/all/2025031926-engraved-footer-3e9b@gregkh/T/

The series includes updates to the documentation and selftests to reflect the new functionality.

v2:
- sync linux/fs.h with the kernel sources
- address comments from Lorenzo and David.

Andrei Vagin (3):
fs/proc: extend the PAGEMAP_SCAN ioctl to report guard regions tools headers UAPI: Sync linux/fs.h with the kernel sources selftests/mm: add PAGEMAP_SCAN guard region test

 Documentation/admin-guide/mm/pagemap.rst   |  1 +
 fs/proc/task_mmu.c                         | 17 ++++---
 include/uapi/linux/fs.h                    |  1 +
 tools/include/uapi/linux/fs.h              | 19 +++++++-
 tools/testing/selftests/mm/guard-regions.c | 57 ++++++++++++++++++++++
 5 files changed, 87 insertions(+), 8 deletions(-)
Signature · 1 line
2.49.0.rc1.451.g8f38331e32-goog