Hi... I am getting rusty in memory management, but hopefully I still recall most of them correctly... On Sat, Oct 24, 2009 at 3:37 AM, Shameem Ahamed <shameem.ahamed@xxxxxxxxx> wrote: > If there is a macro, why we need code for traversing all the page > directories ?. This macro is a simple math, which points to an index in > global mem_map array, which contains all the pages in the system. perhaps what the books mean is VMA owned by a process, thus the address is between 0 and 0xC0000000 (for x86 32 bit)? user space VMA are not mapped in linear fashion (i.e virt address 12 corresponds to physical address C0000012), so you need that a bit complicated translation. Furthermore, kernel virtual address space are mapped identically across all page global directories, so you just need to pick one between them. Maybe I am wrong here..I remember the name is master page global directory and all page global directories are referring to it when dealing with kernel virtual address space. > So my doubts are, > Is the macro only for ZONE_NORMAL (upto 896M, which is directly mapped by > kernel) memory pages ? not only for zone_normal, but for every pages that already mapped into kernel address space. recall that highmem pages which has been kmapped are given address with kernel address space. > Is mem_map array contains pages upto ZONE_NORMAL ? Looking from the definition and the comments above of the mem_map declaration, I took conclusion that mem_map contains page struct of all pages in the system. Whether each individual pages are mapped or not, that's another story > Is page traversing happens only for HIGH_MEM ?. do you mean traversing the page or the page frame? if you mean the page frame and it belongs to user space then I guess the answer is yes -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ