Index: linux-2.6.16-rc4/mm/memory.c =================================================================== --- linux-2.6.16-rc4.orig/mm/memory.c 2006-02-21 15:03:10.000000000 -0800 +++ linux-2.6.16-rc4/mm/memory.c 2006-02-21 15:40:28.000000000 -0800 @@ -48,6 +48,7 @@ #include #include #include +#include #include #include @@ -2205,19 +2206,28 @@ static inline int handle_pte_fault(struc pte_t entry; pte_t old_entry; spinlock_t *ptl; + PC_T c; + + PC_START(c); old_entry = entry = *pte; if (!pte_present(entry)) { if (pte_none(entry)) { - if (!vma->vm_ops || !vma->vm_ops->nopage) + if (!vma->vm_ops || !vma->vm_ops->nopage) { + PC_STOP(c, "Anonymous"); return do_anonymous_page(mm, vma, address, pte, pmd, write_access); + } + PC_STOP(c,"no_page"); return do_no_page(mm, vma, address, pte, pmd, write_access); } - if (pte_file(entry)) + if (pte_file(entry)) { + PC_STOP(c, "file_page"); return do_file_page(mm, vma, address, pte, pmd, write_access, entry); + } + PC_STOP(c,"swap_page"); return do_swap_page(mm, vma, address, pte, pmd, write_access, entry); } @@ -2227,9 +2237,11 @@ static inline int handle_pte_fault(struc if (unlikely(!pte_same(*pte, entry))) goto unlock; if (write_access) { - if (!pte_write(entry)) + if (!pte_write(entry)) { + PC_STOP(c, "WriteOnROPage"); return do_wp_page(mm, vma, address, pte, pmd, ptl, entry); + } entry = pte_mkdirty(entry); current->thread_info->dirty_pte_count++; } @@ -2250,6 +2262,7 @@ static inline int handle_pte_fault(struc } unlock: pte_unmap_unlock(pte, ptl); + PC_STOP(c, "Minor Fault"); return VM_FAULT_MINOR; }