Index: linux-2.6.16-rc4/fs/proc/array.c =================================================================== --- linux-2.6.16-rc4.orig/fs/proc/array.c 2006-02-17 14:23:45.000000000 -0800 +++ linux-2.6.16-rc4/fs/proc/array.c 2006-02-21 15:03:10.000000000 -0800 @@ -171,14 +171,16 @@ static inline char * task_state(struct t "PPid:\t%d\n" "TracerPid:\t%d\n" "Uid:\t%d\t%d\t%d\t%d\n" - "Gid:\t%d\t%d\t%d\t%d\n", + "Gid:\t%d\t%d\t%d\t%d\n" + "Dirty:\t%d Pages\n", get_task_state(p), (p->sleep_avg/1024)*100/(1020000000/1024), p->tgid, p->pid, pid_alive(p) ? p->group_leader->real_parent->tgid : 0, pid_alive(p) && p->ptrace ? p->parent->pid : 0, p->uid, p->euid, p->suid, p->fsuid, - p->gid, p->egid, p->sgid, p->fsgid); + p->gid, p->egid, p->sgid, p->fsgid, + p->thread_info->dirty_pte_count); read_unlock(&tasklist_lock); task_lock(p); rcu_read_lock(); Index: linux-2.6.16-rc4/mm/memory.c =================================================================== --- linux-2.6.16-rc4.orig/mm/memory.c 2006-02-17 14:23:45.000000000 -0800 +++ linux-2.6.16-rc4/mm/memory.c 2006-02-21 15:03:10.000000000 -0800 @@ -2231,6 +2231,7 @@ static inline int handle_pte_fault(struc return do_wp_page(mm, vma, address, pte, pmd, ptl, entry); entry = pte_mkdirty(entry); + current->thread_info->dirty_pte_count++; } entry = pte_mkyoung(entry); if (!pte_same(old_entry, entry)) { Index: linux-2.6.16-rc4/include/asm-ia64/thread_info.h =================================================================== --- linux-2.6.16-rc4.orig/include/asm-ia64/thread_info.h 2006-02-17 14:23:45.000000000 -0800 +++ linux-2.6.16-rc4/include/asm-ia64/thread_info.h 2006-02-21 15:03:10.000000000 -0800 @@ -24,10 +24,11 @@ struct thread_info { struct task_struct *task; /* XXX not really needed, except for dup_task_struct() */ struct exec_domain *exec_domain;/* execution domain */ + __u32 dirty_pte_count; /* Number of outstanding dirty pages */ __u32 flags; /* thread_info flags (see TIF_*) */ + __s32 preempt_count; /* 0=premptable, <0=BUG; will also serve as bh-counter */ __u32 cpu; /* current CPU */ mm_segment_t addr_limit; /* user-level address space limit */ - int preempt_count; /* 0=premptable, <0=BUG; will also serve as bh-counter */ struct restart_block restart_block; struct { int signo; @@ -48,6 +49,7 @@ struct thread_info { .cpu = 0, \ .addr_limit = KERNEL_DS, \ .preempt_count = 0, \ + .dirty_pte_count = 0, \ .restart_block = { \ .fn = do_no_restart_syscall, \ }, \