Jason J. Herne wrote:
1) Notice that for process 1, the VMA's PFN ranges start at a higher number than they end. For process 970 its exactly the opposite. is this normal?? Would the kernel map memory in such a way that the virtual addresses count UP but the corresponding physical addresses count DOWN?
The mapping is not physically contiguous. Each virtual page maps to a different physical page. This is standard behavior for any modern OS and is not unique to Linux.
2) Is it possible that a vma is not contiguous in phsyical memory? If so, when does this happen, is it often? And, is there any easy way (without comparing all addresses in the VMA) to discover this?
Yes. All the time. No.
This sort of thing is covered in any standard college class on operating systems.
3) Why is it that 'kmap 1' shows me that process 1 is only using 1456k
of memory, but the 2nd VMA in processes 1 is (623 pages * 4096 bytes) =
abut 2.5 Megabytes?
Because a page of virtual memory is mapped to a page of physical memory only when it's used. Read up on LRU algorithms for page mapping.
-- Timur Tabi Staff Software Engineer timur.tabi@xxxxxxxxxxx
-- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/