Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755836Ab1CBQhj (ORCPT ); Wed, 2 Mar 2011 11:37:39 -0500 Received: from mx1.redhat.com ([209.132.183.28]:6235 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755774Ab1CBQhg (ORCPT ); Wed, 2 Mar 2011 11:37:36 -0500 Date: Wed, 2 Mar 2011 17:28:12 +0100 From: Oleg Nesterov To: Linus Torvalds , Andrew Morton Cc: KOSAKI Motohiro , LKML , linux-mm , pageexec@freemail.hu, Solar Designer , Eugene Teo , Brad Spengler , Roland McGrath , Milton Miller Subject: [PATCH v3 4/4] exec: document acct_arg_size() Message-ID: <20110302162812.GE26810@redhat.com> References: <20101201182747.GB6143@redhat.com> <20110225175202.GA19059@redhat.com> <20110225175314.GD19059@redhat.com> <20110226123731.GC4416@redhat.com> <20110226174408.GA17442@redhat.com> <20110301204739.GA30406@redhat.com> <20110302162650.GA26810@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110302162650.GA26810@redhat.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 979 Lines: 30 Add the comment to explain acct_arg_size(). Signed-off-by: Oleg Nesterov --- fs/exec.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- 38/fs/exec.c~4_doc_acct_arg_size 2011-03-02 16:21:57.000000000 +0100 +++ 38/fs/exec.c 2011-03-02 16:27:24.000000000 +0100 @@ -164,7 +164,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; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/