projects/linux·commit ae6b585e

exec: document acct_arg_size()

ae6b585e · Oleg Nesterov <[email protected]> · 2011-03-06 18:03:11 +01:00

Add the comment to explain acct_arg_size().

Signed-off-by: Oleg Nesterov <[email protected]>
Reviewed-by: KOSAKI Motohiro <[email protected]>
Commit
ae6b585eeb74670a2dec1fe4394bdfbdb9395cc2
Parents
0e028465

Changes

1 files changed · +6 −1

FileStatusAddDelContent
fs/exec.cmodified+6−1View file

fs/exec.c

View file
diff --git a/fs/exec.c b/fs/exec.c
index 89d788c..5cb53f0 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;