Skip to contentSkip to conversation

move sock_update_memcg outside of CONFIG_INET

PATCH In review Glauber Costa 3 participants 3 messages Jan 16, 2012 – Jan 17, 2012

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 move sock_update_memcg outside of CONFIG_INET

Although only used currently for tcp sockets, this function is now used in common sock code (for sock_clone())

Commit 475f1b52645a29936b9df1d8fcd45f7e56bd4a9f moved the declaration of sock_update_clone() to inside sock.c, but this only fixes the problem when CONFIG_CGROUP_MEM_RES_CTLR_KMEM is also not defined.

This patch here is verified to fix both problems, although reverting the previous one is not necessary.

CC David S. Miller <davem-fT/PcQaiUtIeIZ0/[email protected]>
CC Stephen Rothwell <[email protected]>
---
 mm/memcontrol.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
mm/memcontrol.c +1 -1
index 602207b..3dbff4d 100644
@@ -373,7 +373,6 @@ static void mem_cgroup_put(struct mem_cgroup *memcg);
 
 /* Writing them here to avoid exposing memcg's inner layout */
 #ifdef CONFIG_CGROUP_MEM_RES_CTLR_KMEM
-#ifdef CONFIG_INET
 #include <net/sock.h>
 #include <net/ip.h>
 
@@ -420,6 +419,7 @@ void sock_release_memcg(struct sock *sk)
 	}
 }
 
+#ifdef CONFIG_INET
 struct cg_proto *tcp_proto_cgroup(struct mem_cgroup *memcg)
 {
 	if (!memcg || mem_cgroup_is_root(memcg))
Signature · 1 line
1.7.7.4
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Glauber Costa

Although only used currently for tcp sockets, this function is now used in common sock code (for sock_clone())

Commit 475f1b52645a29936b9df1d8fcd45f7e56bd4a9f moved the declaration of sock_update_clone() to inside sock.c, but this only fixes the problem when CONFIG_CGROUP_MEM_RES_CTLR_KMEM is also not defined.

Quoted 6 lines

This patch here is verified to fix both problems, although reverting the previous one is not necessary.

CC David S. Miller <[email protected]>
CC Stephen Rothwell <[email protected]>

Thanks.

Quoted 24 lines
---
 mm/memcontrol.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
mm/memcontrol.c +1 -1
index 602207b..3dbff4d 100644
@@ -373,7 +373,6 @@ static void mem_cgroup_put(struct mem_cgroup *memcg);
 
 /* Writing them here to avoid exposing memcg's inner layout */
 #ifdef CONFIG_CGROUP_MEM_RES_CTLR_KMEM
-#ifdef CONFIG_INET
 #include <net/sock.h>
 #include <net/ip.h>
 
@@ -420,6 +419,7 @@ void sock_release_memcg(struct sock *sk)
 	}
 }
 
+#ifdef CONFIG_INET
 struct cg_proto *tcp_proto_cgroup(struct mem_cgroup *memcg)
 {
 	if (!memcg || mem_cgroup_is_root(memcg))
Signature · 2 lines
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
maintainer
#2 lore raw
In reply to Glauber Costa

From: Glauber Costa <[email protected]>
Date: Mon, 16 Jan 2012 12:04:39 +0400

Quoted 8 lines

Although only used currently for tcp sockets, this function is now used in common sock code (for sock_clone())

Commit 475f1b52645a29936b9df1d8fcd45f7e56bd4a9f moved the declaration of sock_update_clone() to inside sock.c, but this only fixes the problem when CONFIG_CGROUP_MEM_RES_CTLR_KMEM is also not defined.

Quoted 4 lines

This patch here is verified to fix both problems, although reverting the previous one is not necessary.

Applied, but with a fixed subject line, you must always prefix your subject line with the subsystem your change is being made to. In this case simply "net: " would have been sufficient, so that's what I added.