Re: [PATCH] cgroups: don't depend on CONFIG_MM_OWNER

Previous thread: [RFC][PATCH] x86: add memory clobber in switch_to() by Vegard Nossum on Sunday, September 14, 2008 - 1:03 pm. (2 messages)

Next thread: Re: + itimers-fix-itimer-many-thread-hang.patch added to -mm tree by Oleg Nesterov on Sunday, September 14, 2008 - 1:50 pm. (6 messages)
To: <akpm@...>
Cc: <linux-kernel@...>, <menage@...>, <balbir@...>
Date: Sunday, September 14, 2008 - 1:37 pm

From: Pekka Enberg <penberg@cs.helsinki.fi>

The revoke patches, for example, select CONFIG_MM_OWNER independently of
cgroups. Therefore, don't depend on CONFIG_MM_OWNER in cgroup specific code.

Cc: Paul Menage <menage@google.com>
Cc: Balbir Singh <balbir@linux.vnet.ibm.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
---
include/linux/cgroup.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index c98dd7c..e270ec3 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -413,10 +413,10 @@ static inline int cgroupstats_build(struct cgroupstats *stats,

#endif /* !CONFIG_CGROUPS */

-#ifdef CONFIG_MM_OWNER
+#ifdef CONFIG_CGROUP_MEM_RES_CTLR
extern void
cgroup_mm_owner_callbacks(struct task_struct *old, struct task_struct *new);
-#else /* !CONFIG_MM_OWNER */
+#else /* !CONFIG_CGROUP_MEM_RES_CTLR */
static inline void
cgroup_mm_owner_callbacks(struct task_struct *old, struct task_struct *new)
{
--
1.5.4.3

--

To: Pekka J Enberg <penberg@...>
Cc: <akpm@...>, <linux-kernel@...>, <balbir@...>
Date: Monday, September 15, 2008 - 1:55 pm

Yes, the existing code doesn't seem quite right - if !CONFIG_MM_OWNER
then we don't need to even define a trivial version of
cgroup_mm_owner_callbacks()

But your patch is too specific - tying the existance of
cgroup_mm_owner_callbacks() to the memory controller would break other
controllers (e.g. the memrlimit or swap controllers, which also want
to use it)

How about:

- any cgroup that needs mm-owner callbacks selects an option
CGROUP_MM_OWNER_CALLBACK

- CGROUP_MM_OWNER_CALLBACK selects MM_OWNER and triggers the
definition of a non-trivial cgroup_mm_owner_callbacks() function

--

To: Paul Menage <menage@...>
Cc: <akpm@...>, <linux-kernel@...>, <balbir@...>
Date: Monday, September 15, 2008 - 1:56 pm

Hi Paul,

Yeah, sounds good to me. I just want to be able to select
CONFIG_MM_OWNER separately for my revoke patches.

Pekka
--

Previous thread: [RFC][PATCH] x86: add memory clobber in switch_to() by Vegard Nossum on Sunday, September 14, 2008 - 1:03 pm. (2 messages)

Next thread: Re: + itimers-fix-itimer-many-thread-hang.patch added to -mm tree by Oleg Nesterov on Sunday, September 14, 2008 - 1:50 pm. (6 messages)