Index: linux-2.6.16-rc4/mm/slab.c =================================================================== --- linux-2.6.16-rc4.orig/mm/slab.c 2006-02-17 14:23:45.000000000 -0800 +++ linux-2.6.16-rc4/mm/slab.c 2006-02-21 11:20:28.000000000 -0800 @@ -105,6 +105,7 @@ #include #include #include +#include #include #include @@ -3472,25 +3473,33 @@ static void cache_reap(void *unused) { struct list_head *walk; struct kmem_list3 *l3; + PC_T count; + + PC_START(count); if (!mutex_trylock(&cache_chain_mutex)) { /* Give up. Setup the next iteration. */ schedule_delayed_work(&__get_cpu_var(reap_work), REAPTIMEOUT_CPUC); + PC_STOP(count, "MutexLocked"); return; } + PC_STOP(count, "cache_reap_mutex"); list_for_each(walk, &cache_chain) { struct kmem_cache *searchp; struct list_head *p; int tofree; struct slab *slabp; + PC_T loop; searchp = list_entry(walk, struct kmem_cache, next); if (searchp->flags & SLAB_NO_REAP) goto next; + PC_START(loop); + check_irq_on(); l3 = searchp->nodelists[numa_node_id()]; @@ -3501,6 +3510,8 @@ static void cache_reap(void *unused) drain_array_locked(searchp, cpu_cache_get(searchp), 0, numa_node_id()); + PC_STOP(loop, "cache_reap_inner_cpucache"); + if (time_after(l3->next_reap, jiffies)) goto next_unlock; @@ -3515,6 +3526,7 @@ static void cache_reap(void *unused) goto next_unlock; } + PC_STOP(loop, "cache_reap_inner_drain"); tofree = (l3->free_limit + 5 * searchp->num - 1) / (5 * searchp->num); @@ -3541,13 +3553,16 @@ static void cache_reap(void *unused) next_unlock: spin_unlock_irq(&l3->list_lock); next: + PC_STOP(loop, "cache_reap_inner_total"); cond_resched(); } check_irq_on(); mutex_unlock(&cache_chain_mutex); + PC_STOP(count, "cache_reap_scan"); drain_remote_pages(); /* Setup the next iteration */ schedule_delayed_work(&__get_cpu_var(reap_work), REAPTIMEOUT_CPUC); + PC_STOP(count,"cache_reap_total"); } #ifdef CONFIG_PROC_FS Index: linux-2.6.16-rc4/mm/memory.c =================================================================== --- linux-2.6.16-rc4.orig/mm/memory.c 2006-02-21 11:07:25.000000000 -0800 +++ linux-2.6.16-rc4/mm/memory.c 2006-02-21 11:29:47.000000000 -0800 @@ -48,6 +48,7 @@ #include #include #include +#include #include #include @@ -1457,6 +1458,9 @@ static int do_wp_page(struct mm_struct * int reuse = can_share_swap_page(old_page); unlock_page(old_page); if (reuse) { + PC_T c; + PC_START(c); + flush_cache_page(vma, address, pte_pfn(orig_pte)); entry = pte_mkyoung(orig_pte); entry = maybe_mkwrite(pte_mkdirty(entry), vma); @@ -1464,6 +1468,7 @@ static int do_wp_page(struct mm_struct * update_mmu_cache(vma, address, entry); lazy_mmu_prot_update(entry); ret |= VM_FAULT_WRITE; + PC_STOP(c, "dirty_do_wp_page"); goto unlock; } } @@ -2227,11 +2232,14 @@ static inline int handle_pte_fault(struc if (unlikely(!pte_same(*pte, entry))) goto unlock; if (write_access) { + PC_T c; if (!pte_write(entry)) return do_wp_page(mm, vma, address, pte, pmd, ptl, entry); + PC_START(c); entry = pte_mkdirty(entry); current->thread_info->dirty_pte_count++; + PC_STOP(c,"fault_dirty"); } entry = pte_mkyoung(entry); if (!pte_same(old_entry, entry)) {