From 4e4db44fe1dd584dcf7b8821cb9306eea7d449f8 Mon Sep 17 00:00:00 2001 From: Oleg Nesterov Date: Sun, 6 Mar 2011 18:03:11 +0100 Subject: [PATCH] --- yaml --- r: 247950 b: refs/heads/master c: ae6b585eeb74670a2dec1fe4394bdfbdb9395cc2 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/exec.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 9c4fc0a39366..e546af1d457b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0e028465d18b7c6797fcbdea632299d16097c5cd +refs/heads/master: ae6b585eeb74670a2dec1fe4394bdfbdb9395cc2 diff --git a/trunk/fs/exec.c b/trunk/fs/exec.c index 89d788ca7829..5cb53f0232b1 100644 --- a/trunk/fs/exec.c +++ b/trunk/fs/exec.c @@ -167,7 +167,12 @@ SYSCALL_DEFINE1(uselib, const char __user *, library) } #ifdef CONFIG_MMU - +/* + * The nascent bprm->mm is not visible until exec_mmap() but it can + * use a lot of memory, account these pages in current->mm temporary + * for oom_badness()->get_mm_rss(). Once exec succeeds or fails, we + * change the counter back via acct_arg_size(0). + */ static void acct_arg_size(struct linux_binprm *bprm, unsigned long pages) { struct mm_struct *mm = current->mm;