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,
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)
{
......
......@@ -729,6 +729,7 @@ struct anon_vma *find_mergeable_anon_vma(struct vm_area_struct *vma)
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).
......
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