0

I'm trying to locate exact machine memory pages that have been allocated back files which are stored in a Linux RAM disk. For example, for a process, there is /proc/pid/pagemap that tells you exactly which machine pages a process is using. I'm looking for similar thing for RAM disks. Do you know of a kernel module or data structure that may have list of the pages assigned to a RAM disk?

For example, if I create a RAM disk 1MB in size (assuming 4KB pages) that means there should be 256 machine pages assigned to that RAM disk (2^22/2^14=256).

RAM disks build on Linux's page cache, so seems like a good point to start at, but I'm not sure how to correlate which page cache entries correspond to a RAM disk.

1 Answers1

2

i think its not the exact memory locations that are shown to you in /proc/pid/pagemap. these are the virtual memory mappings(frame).

pagemap is a new (as of 2.6.25) set of interfaces in the kernel that allow userspace programs to examine the page tables and related information by reading files in /proc.

more info follow

https://www.kernel.org/doc/Documentation/vm/pagemap.txt

shiv garg
  • 761
  • 1
  • 8
  • 26