title: Why I have pte not present pages when swap is off
body: <p>I go throught vm_area_struct areas of the task and try to get corresponding struct page * (pages), but some pages is not present in RAM: pte_present(*pte) returns 0. I can't understand this behaviour because I have no swap area, so I suppose that all userspace virtual space maps into presented pages in RAM. Could anybody explain me this?</p>
  
  <pre><code>static struct page * get_page(unsigned long addr)
  {
      pgd_t *pgd;
      pte_t *pte;
      pud_t *pud;
      pmd_t *pmd;
      struct page *pg;
      struct mm_struct *mm = current-&gt;mm;
  
      pgd = pgd_offset(mm, addr);
      if (pgd_none_or_clear_bad(pgd)) {
              goto err;
      }
  
      pud = pud_offset(pgd, addr);
      if (pud_none(*pud) || pud_bad(*pud)) {
              goto err;
      }
  
      pmd = pmd_offset(pud, addr);
      if (pmd_none(*pmd) || pmd_bad(*pmd)) {
              goto err;
      }
  
      pte = pte_offset_map(pmd, addr);
      if (!pte) {
              goto err;
      }
  
      if (!pte_present(*pte)) {
              PR("pte is not present\n");
              goto err;
      }
  
      pg = pte_page(*pte);
      if (!pg) {                
              pte_unmap(pte);
              goto err;
      }
  
      pte_unmap(pte);
  </code></pre>