From 323d129f0446331f24302609dd0736c819f06bea Mon Sep 17 00:00:00 2001 From: William Lee Irwin III Date: Thu, 26 Aug 2004 20:36:38 -0700 Subject: [PATCH] [PATCH] speed up /proc/pid/statm for !CONFIG_PROC_FS Remove the accounting overhead when CONFIG_PROC_FS is not defined. Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/mm.h | 8 ++++++++ mm/mmap.c | 2 ++ 2 files changed, 10 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index 8d61ba9895ab7..7a47263511f0f 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -752,7 +752,15 @@ extern struct page * follow_page(struct mm_struct *mm, unsigned long address, 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 --git a/mm/mmap.c b/mm/mmap.c index 0857b7ac2f034..cac244415b6c7 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -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 *mm, unsigned long flags, if (flags & VM_EXEC) mm->exec_vm += pages; } +#endif /* CONFIG_PROC_FS */ /* * The caller must hold down_write(current->mm->mmap_sem). -- 2.53.0