I'm now wondering whether for Tiberiu's case mincore() can also be used. It
should just still be a bit slow because it'll look up the cache too, but it
should work similarly like the original proposal.
I am afraid that the information returned by mincore is a little too vague to be of better help, compared to what the pagemap should provide in theory. I will have a look to see whether lseek on
proc/map_files works as a "PM_SWAP" equivalent. However, the swap offset would still be missing.
We could take into consideration an alternative approach to retrieving the shared page info in user
Very right, maybe we can just avoid tampering with pagemap on shmem completely (which sounds like an excellent idea to me) and document it as "On shared memory, we will never indicate SWAPPED if the pages have been swapped out. Further, PRESENT might be under-indicated: if a shared page is currently not mapped into the page table of a process.". I saw there was a related, proposed doc update, maybe we can finetune that.
space, like storing it in sys/fs instead of per process. However, just leaving the pagemap functionality
incomplete, and not providing an alternative to retrieve the missing information, does not seem right. Updating the docs with a "can't do" should be temporary, until an alternative or fix.
Also, I think you are talking about my own doc update patch[3]. If not, please share a link with your
next reply.
[3] https://marc.info/?m=162878395426774