exec: document acct_arg_size()
authorOleg Nesterov <oleg@redhat.com>
Sun, 6 Mar 2011 17:03:11 +0000 (18:03 +0100)
committerOleg Nesterov <oleg@redhat.com>
Sat, 9 Apr 2011 13:53:57 +0000 (15:53 +0200)
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>
fs/exec.c

index 89d788c..5cb53f0 100644 (file)
--- 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;