From: William Lee Irwin III Remove the accounting overhead when CONFIG_PROC_FS is not defined. Signed-off-by: Andrew Morton --- 25-akpm/include/linux/mm.h | 8 ++++++++ 25-akpm/mm/mmap.c | 2 ++ 2 files changed, 10 insertions(+) diff -puN include/linux/mm.h~task-statm-no-procfs-fix include/linux/mm.h --- 25/include/linux/mm.h~task-statm-no-procfs-fix 2004-08-25 00:33:03.883220080 -0700 +++ 25-akpm/include/linux/mm.h 2004-08-25 00:33:03.889219168 -0700 @@ -754,7 +754,15 @@ extern struct page * follow_page(struct int write); extern int remap_page_range(struct vm_area_struct *vma, unsigned long from, unsigned long to, unsigned long size, pgprot_t prot); + +#ifdef CONFIG_PROC_FS void __vm_stat_account(struct mm_struct *, unsigned long, struct file *, long); +#else +static inline void __vm_stat_account(struct mm_struct *mm, + unsigned long flags, struct file *file, long pages) +{ +} +#endif /* CONFIG_PROC_FS */ static inline void vm_stat_account(struct vm_area_struct *vma) { diff -puN mm/mmap.c~task-statm-no-procfs-fix mm/mmap.c --- 25/mm/mmap.c~task-statm-no-procfs-fix 2004-08-25 00:33:03.885219776 -0700 +++ 25-akpm/mm/mmap.c 2004-08-25 00:33:03.890219016 -0700 @@ -729,6 +729,7 @@ none: return NULL; } +#ifdef CONFIG_PROC_FS void __vm_stat_account(struct mm_struct *mm, unsigned long flags, struct file *file, long pages) { @@ -750,6 +751,7 @@ void __vm_stat_account(struct mm_struct if (flags & VM_EXEC) mm->exec_vm += pages; } +#endif /* CONFIG_PROC_FS */ /* * The caller must hold down_write(current->mm->mmap_sem). _