Index: linux-2.6.16-rc5-mm3/mm/swapfile.c =================================================================== --- linux-2.6.16-rc5-mm3.orig/mm/swapfile.c 2006-03-07 09:17:26.000000000 -0800 +++ linux-2.6.16-rc5-mm3/mm/swapfile.c 2006-03-07 11:43:07.000000000 -0800 @@ -480,6 +480,8 @@ unsigned int count_swap_pages(int type, static void unuse_pte(struct vm_area_struct *vma, pte_t *pte, unsigned long addr, swp_entry_t entry, struct page *page) { + pte_t old = *pte; + inc_mm_counter(vma->vm_mm, anon_rss); get_page(page); set_pte_at(vma->vm_mm, addr, pte, @@ -491,6 +493,8 @@ static void unuse_pte(struct vm_area_str * immediately swapped out again after swapon. */ activate_page(page); + printk(KERN_ERR "unuse_pte: replaced pte=%lx with %lx @ %p\n", + pte_val(old), pte_val(*pte), pte); } static int unuse_pte_range(struct vm_area_struct *vma, pmd_t *pmd, Index: linux-2.6.16-rc5-mm3/mm/rmap.c =================================================================== --- linux-2.6.16-rc5-mm3.orig/mm/rmap.c 2006-03-07 11:42:14.000000000 -0800 +++ linux-2.6.16-rc5-mm3/mm/rmap.c 2006-03-07 11:43:07.000000000 -0800 @@ -637,6 +637,7 @@ static int try_to_unmap_one(struct page } set_pte_at(mm, address, pte, swp_entry_to_pte(entry)); BUG_ON(pte_file(*pte)); + printk(KERN_ERR "Installed swap pte=%lx @ %p\n", pte_val(*pte), pte); dec_mm_counter(mm, anon_rss); } else dec_mm_counter(mm, file_rss);