aboutsummaryrefslogtreecommitdiff
path: root/fs/exec.c
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2011-03-06 18:03:11 +0100
committerOleg Nesterov <oleg@redhat.com>2011-04-09 15:53:57 +0200
commitae6b585eeb74670a2dec1fe4394bdfbdb9395cc2 (patch)
treeea1642cc0abf3b73573769bdb15c8d390bc3e7c8 /fs/exec.c
parent0e028465d18b7c6797fcbdea632299d16097c5cd (diff)
exec: document acct_arg_size()
Add the comment to explain acct_arg_size(). Signed-off-by: Oleg Nesterov <oleg@redhat.com> Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Diffstat (limited to 'fs/exec.c')
-rw-r--r--fs/exec.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/exec.c b/fs/exec.c
index 89d788ca782..5cb53f0232b 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -167,7 +167,12 @@ out:
}
#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;