All pages belonging to a process

From: Anupama Chandwani
Date: Tue Aug 25 2009 - 02:36:46 EST


Hi,

I need to have a debug print for all pages belonging to a process, for
which i have the following code:

if (task->mm && task->mm->mmap)
{
      /* For all vma-s of a process */
      for (vma = task->mm->mmap; vma!=NULL; vma = vma->next)
      {
               pgd = pgd_offset(mm, address);
               if (!pgd_present(*pgd))
                    continue;

               pud = pud_offset(pgd, address);
               if (!pud_present(*pud))
                    continue;

               pmd = pmd_offset(pud, address);
               if (!pmd_present(*pmd))
                    continue;

              pte = pte_offset_map_lock (task->mm->vm_mm, pmd, address, &ptl);

              print pte_pfn(*pte) and other debug info;

              pte_unmap_unlock(pte, ptl);
      }
}

The code hangs. I do not get anything in dmesg.
Any pointers by observing the code?

--
Cheers,
Anupama Chandwani
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/