Re: [-mm][PATCH 2/4] Setup the memrlimit controller (v5)

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andrea Righi
Date: Wednesday, June 11, 2008 - 10:10 am

Balbir Singh wrote:

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 <righi.andrea@gmail.com>
---
 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 <linux/res_counter.h>
 #include <linux/memrlimitcgroup.h>
 
+#define PAGE_ALIGN64(addr) (((((addr)+PAGE_SIZE-1))>>PAGE_SHIFT)<<PAGE_SHIFT)
+
 struct cgroup_subsys memrlimit_cgroup_subsys;
 
 struct memrlimit_cgroup {
@@ -124,7 +126,7 @@ static int memrlimit_cgroup_write_strategy(char *buf, unsigned long long *tmp)
 	if (*buf != '\0')
 		return -EINVAL;
 
-	*tmp = PAGE_ALIGN(*tmp);
+	*tmp = PAGE_ALIGN64(*tmp);
 	return 0;
 }
 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[-mm][PATCH 0/4] Add memrlimit controller (v5), Balbir Singh, (Wed May 21, 8:29 am)
[-mm][PATCH 2/4] Setup the memrlimit controller (v5), Balbir Singh, (Wed May 21, 8:29 am)
Re: [-mm][PATCH 2/4] Setup the memrlimit controller (v5), Andrew Morton, (Wed May 21, 9:18 pm)
Re: [-mm][PATCH 2/4] Setup the memrlimit controller (v5), Andrea Righi, (Wed Jun 11, 10:10 am)
Re: [-mm][PATCH 2/4] Setup the memrlimit controller (v5), Balbir Singh, (Wed Jun 11, 10:33 am)
Re: [-mm][PATCH 2/4] Setup the memrlimit controller (v5), Andrea Righi, (Wed Jun 11, 11:48 am)
Re: [-mm][PATCH 2/4] Setup the memrlimit controller (v5), Andrew Morton, (Wed Jun 11, 12:15 pm)
Re: [-mm][PATCH 2/4] Setup the memrlimit controller (v5), Andrew Morton, (Wed Jun 11, 1:43 pm)
Re: [-mm][PATCH 2/4] Setup the memrlimit controller (v5), Andrew Morton, (Wed Jun 11, 3:55 pm)
Re: [-mm][PATCH 2/4] Setup the memrlimit controller (v5), Balbir Singh, (Wed Jun 11, 11:13 pm)
Re: [-mm][PATCH 2/4] Setup the memrlimit controller (v5), Andrew Morton, (Thu Jun 12, 2:02 am)