Virtual address to physical page mapping can be changed during application runtime by swapping or physical page reallocation for memory defragmentation or etc.
What if I want to cache physical page numbers (PPNs) of some virtual address range from /proc/PID/pagemap, since accessing proc/PID/pagemap is extremely expansive overhead to be checked every time, is there a way to be notified if a page has been moved to other physical address or swapped, on the effective address or just any part of memory?
Any kind of method will be ok(not just userspace method, but also those that can be only implemented in kernel space).