Commit 323d129f authored by William Lee Irwin III's avatar William Lee Irwin III Committed by Linus Torvalds

[PATCH] speed up /proc/pid/statm for !CONFIG_PROC_FS

Remove the accounting overhead when CONFIG_PROC_FS is not defined.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 9683ede1
...@@ -752,7 +752,15 @@ extern struct page * follow_page(struct mm_struct *mm, unsigned long address, ...@@ -752,7 +752,15 @@ extern struct page * follow_page(struct mm_struct *mm, unsigned long address,
int write); int write);
extern int remap_page_range(struct vm_area_struct *vma, unsigned long from, extern int remap_page_range(struct vm_area_struct *vma, unsigned long from,
unsigned long to, unsigned long size, pgprot_t prot); 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); 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) static inline void vm_stat_account(struct vm_area_struct *vma)
{ {
......
...@@ -729,6 +729,7 @@ struct anon_vma *find_mergeable_anon_vma(struct vm_area_struct *vma) ...@@ -729,6 +729,7 @@ struct anon_vma *find_mergeable_anon_vma(struct vm_area_struct *vma)
return NULL; return NULL;
} }
#ifdef CONFIG_PROC_FS
void __vm_stat_account(struct mm_struct *mm, unsigned long flags, void __vm_stat_account(struct mm_struct *mm, unsigned long flags,
struct file *file, long pages) struct file *file, long pages)
{ {
...@@ -750,6 +751,7 @@ void __vm_stat_account(struct mm_struct *mm, unsigned long flags, ...@@ -750,6 +751,7 @@ void __vm_stat_account(struct mm_struct *mm, unsigned long flags,
if (flags & VM_EXEC) if (flags & VM_EXEC)
mm->exec_vm += pages; mm->exec_vm += pages;
} }
#endif /* CONFIG_PROC_FS */
/* /*
* The caller must hold down_write(current->mm->mmap_sem). * The caller must hold down_write(current->mm->mmap_sem).
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment