]> git.hungrycats.org Git - linux/commitdiff
[PATCH] speed up /proc/pid/statm for !CONFIG_PROC_FS
authorWilliam Lee Irwin III <wli@holomorphy.com>
Fri, 27 Aug 2004 03:36:38 +0000 (20:36 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Fri, 27 Aug 2004 03:36:38 +0000 (20:36 -0700)
Remove the accounting overhead when CONFIG_PROC_FS is not defined.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
include/linux/mm.h
mm/mmap.c

index 8d61ba9895ab7e6be598724ab0b8f5bec9c839da..7a47263511f0fb81864ead9a2f699d042d3d499f 100644 (file)
@@ -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)
 {
index 0857b7ac2f034e43c56c639d73886be9e7afba59..cac244415b6c71f336f0dd57f8ebbb050304af1c 100644 (file)
--- 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).