title: Find page in memory for Process (linux-kernel)
body: <p>Basically I have a program that can find all the VMA's of a process, but I would like to look at the pages in the page table for that process as well. I'm stumped. I know that the task_struct for the process has a field </p>
  
  <pre><code>pgd_t                  *pgd;                /* page global directory */
  </code></pre>
  
  <p>Is that just an array of indexes to ALL of the pages? </p>
  
  <p>I found this function inside of "/mm/memory.c"</p>
  
  <pre><code>/*
  * Do a quick page-table lookup for a single page.
  */
  struct page *follow_page(struct vm_area_struct *vma, unsigned long address,
                      unsigned int flags)
  </code></pre>
  
  <p>I can pass it a VMA, but I am unsure about what the address and flags should be. Or perhaps this isn't what I want? Any advice?</p>