--- mm/memory.c | 1 + mm/mmap.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) Index: linux-2.6/mm/mmap.c =================================================================== --- linux-2.6.orig/mm/mmap.c 2008-03-19 12:39:11.013652791 -0700 +++ linux-2.6/mm/mmap.c 2008-03-19 12:39:11.721670709 -0700 @@ -2059,7 +2059,11 @@ void exit_mmap(struct mm_struct *mm) while (vma) vma = remove_vma(vma); - BUG_ON(mm->nr_ptes > (FIRST_USER_ADDRESS+PMD_SIZE-1)>>PMD_SHIFT); + if (mm->nr_ptes) + printk(KERN_CRIT "exit_mmap: nr_ptes=%lu limit=%lu\n", + mm->nr_ptes, (FIRST_USER_ADDRESS+PMD_SIZE-1)>>PMD_SHIFT); + +// BUG_ON(mm->nr_ptes > (FIRST_USER_ADDRESS+PMD_SIZE-1)>>PMD_SHIFT); } /* Insert vm structure into process list sorted by address Index: linux-2.6/mm/memory.c =================================================================== --- linux-2.6.orig/mm/memory.c 2008-03-19 12:39:38.314361343 -0700 +++ linux-2.6/mm/memory.c 2008-03-19 12:59:15.711269542 -0700 @@ -137,6 +137,7 @@ static void free_pte_range(struct mmu_ga pgtable_t token = pmd_pgtable(*pmd); pmd_clear(pmd); pte_free_tlb(tlb, token); + WARN_ON(smp_processor_id() != tlb->cpu); tlb->mm->nr_ptes--; }