From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <4850070F.6060305@gmail.com> From: Andrea Righi Reply-To: righi.andrea@gmail.com MIME-Version: 1.0 Subject: Re: [-mm][PATCH 2/4] Setup the memrlimit controller (v5) References: <20080521152921.15001.65968.sendpatchset@localhost.localdomain> <20080521152948.15001.39361.sendpatchset@localhost.localdomain> In-Reply-To: <20080521152948.15001.39361.sendpatchset@localhost.localdomain> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 11 Jun 2008 19:10:40 +0200 (MEST) Sender: owner-linux-mm@kvack.org Return-Path: To: Balbir Singh Cc: linux-mm@kvack.org, Sudhir Kumar , YAMAMOTO Takashi , Paul Menage , lizf@cn.fujitsu.com, linux-kernel@vger.kernel.org, Pavel Emelianov , Andrew Morton , KAMEZAWA Hiroyuki List-ID: Balbir Singh wrote: > +static int memrlimit_cgroup_write_strategy(char *buf, unsigned long long *tmp) > +{ > + *tmp = memparse(buf, &buf); > + if (*buf != '\0') > + return -EINVAL; > + > + *tmp = PAGE_ALIGN(*tmp); > + return 0; > +} We shouldn't use PAGE_ALIGN() here, otherwise we limit the address space to 4GB on 32-bit architectures (that could be reasonable, because this is a per-cgroup limit and not per-process). Signed-off-by: Andrea Righi --- mm/memrlimitcgroup.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/mm/memrlimitcgroup.c b/mm/memrlimitcgroup.c index 9a03d7d..2d42ff3 100644 --- a/mm/memrlimitcgroup.c +++ b/mm/memrlimitcgroup.c @@ -29,6 +29,8 @@ #include #include +#define PAGE_ALIGN64(addr) (((((addr)+PAGE_SIZE-1))>>PAGE_SHIFT)< email@kvack.org