From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759171AbYENNl2 (ORCPT ); Wed, 14 May 2008 09:41:28 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751684AbYENNlT (ORCPT ); Wed, 14 May 2008 09:41:19 -0400 Received: from sacred.ru ([62.205.161.221]:37712 "EHLO sacred.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750906AbYENNlS (ORCPT ); Wed, 14 May 2008 09:41:18 -0400 Message-ID: <482AE9FA.4080004@openvz.org> Date: Wed, 14 May 2008 17:32:42 +0400 From: Pavel Emelyanov User-Agent: Thunderbird 2.0.0.14 (X11/20080421) MIME-Version: 1.0 To: Balbir Singh CC: linux-mm@kvack.org, Sudhir Kumar , YAMAMOTO Takashi , Paul Menage , lizf@cn.fujitsu.com, linux-kernel@vger.kernel.org, Andrew Morton , KAMEZAWA Hiroyuki Subject: Re: [-mm][PATCH 4/4] Add memrlimit controller accounting and control (v4) References: <20080514130904.24440.23486.sendpatchset@localhost.localdomain> <20080514130951.24440.73671.sendpatchset@localhost.localdomain> In-Reply-To: <20080514130951.24440.73671.sendpatchset@localhost.localdomain> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-3.0 (sacred.ru [62.205.161.221]); Wed, 14 May 2008 17:35:03 +0400 (MSD) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Balbir Singh wrote: > This patch adds support for accounting and control of virtual address space > limits. The accounting is done via the rlimit_cgroup_(un)charge_as functions. > The core of the accounting takes place during fork time in copy_process(), > may_expand_vm(), remove_vma_list() and exit_mmap(). There are some special > cases that are handled here as well (arch/ia64/kernel/perform.c, > arch/x86/kernel/ptrace.c, insert_special_mapping()) > > Signed-off-by: Balbir Singh > --- > > Signed-off-by: Balbir Singh > --- > > arch/ia64/kernel/perfmon.c | 6 ++ > arch/x86/kernel/ptrace.c | 17 +++++-- > fs/exec.c | 5 ++ > include/linux/memrlimitcgroup.h | 21 ++++++++ > kernel/fork.c | 8 +++ > mm/memrlimitcgroup.c | 94 ++++++++++++++++++++++++++++++++++++++++ > mm/mmap.c | 11 ++++ > 7 files changed, 157 insertions(+), 5 deletions(-) > > diff -puN arch/ia64/kernel/perfmon.c~memrlimit-controller-address-space-accounting-and-control arch/ia64/kernel/perfmon.c > --- linux-2.6.26-rc2/arch/ia64/kernel/perfmon.c~memrlimit-controller-address-space-accounting-and-control 2008-05-14 18:09:32.000000000 +0530 > +++ linux-2.6.26-rc2-balbir/arch/ia64/kernel/perfmon.c 2008-05-14 18:09:32.000000000 +0530 > @@ -40,6 +40,7 @@ > #include > #include > #include > +#include > > #include > #include > @@ -2294,6 +2295,9 @@ pfm_smpl_buffer_alloc(struct task_struct > > DPRINT(("sampling buffer rsize=%lu size=%lu bytes\n", rsize, size)); > > + if (memrlimit_cgroup_charge_as(mm, size >> PAGE_SHIFT)) > + return -ENOMEM; > + AFAIS you didn't cover all the cases when VM expands. At least all the arch/ia64/ia32/binfmt_elf32.c is missed. I'd insert this charge into insert_vm_struct. This would a) cover all of the missed cases and b) reduce the amount of places to patch. [snip the rest of the patch]