Skip to content

Commit ae6b585

Browse files
committed
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>
1 parent 0e02846 commit ae6b585

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎fs/exec.c‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,12 @@ SYSCALL_DEFINE1(uselib, const char __user *, library)
167167
}
168168

169169
#ifdef CONFIG_MMU
170-
170+
/*
171+
* The nascent bprm->mm is not visible until exec_mmap() but it can
172+
* use a lot of memory, account these pages in current->mm temporary
173+
* for oom_badness()->get_mm_rss(). Once exec succeeds or fails, we
174+
* change the counter back via acct_arg_size(0).
175+
*/
171176
static void acct_arg_size(struct linux_binprm *bprm, unsigned long pages)
172177
{
173178
struct mm_struct *mm = current->mm;

0 commit comments

Comments
 (0)