linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH next-20130703] net: sock: Add ifdef CONFIG_MEMCG_KMEM for mem_cgroup_sockets_{init,destroy}
@ 2013-07-03 12:14 Sedat Dilek
  2013-07-03 12:40 ` Sergei Shtylyov
  0 siblings, 1 reply; 14+ messages in thread
From: Sedat Dilek @ 2013-07-03 12:14 UTC (permalink / raw)
  To: David S. Miller, netdev, linux-kernel, Li Zefan, Andrew Morton,
	linux-next, Stephen Rothwell, linux-mm
  Cc: Sedat Dilek

When "CONFIG_MEMCG_KMEM=n" I see this in my build-log:
...
 LD      init/built-in.o
mm/built-in.o: In function `mem_cgroup_css_free':
memcontrol.c:(.text+0x5caa6): undefined reference to `mem_cgroup_sockets_destroy'
make[2]: *** [vmlinux] Error 1

Inspired by the ifdef for mem_cgroup_sockets_{init,destroy} here...

[ net/core/sock.c ]
...
int mem_cgroup_sockets_init()
...
void mem_cgroup_sockets_destroy()
...

...I did the the same for both in "include/net/sock.h".

This fixes the issue for me in next-20130703.

Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com>
---
 include/net/sock.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/net/sock.h b/include/net/sock.h
index ea6206c..ad4bf7f 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -71,6 +71,7 @@
 struct cgroup;
 struct cgroup_subsys;
 #ifdef CONFIG_NET
+#ifdef CONFIG_MEMCG_KMEM
 int mem_cgroup_sockets_init(struct mem_cgroup *memcg, struct cgroup_subsys *ss);
 void mem_cgroup_sockets_destroy(struct mem_cgroup *memcg);
 #else
@@ -83,7 +84,8 @@ static inline
 void mem_cgroup_sockets_destroy(struct mem_cgroup *memcg)
 {
 }
-#endif
+#endif /* CONFIG_NET */
+#endif /* CONFIG_MEMCG_KMEM */
 /*
  * This structure really needs to be cleaned up.
  * Most of it is for TCP, and not used by any of
-- 
1.8.3.2

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 14+ messages in thread
* [PATCH next-20130703] net: sock: Add ifdef CONFIG_MEMCG_KMEM for mem_cgroup_sockets_{init,destroy}
@ 2013-07-03 12:19 Sedat Dilek
  2013-07-03 12:51 ` Li Zefan
  0 siblings, 1 reply; 14+ messages in thread
From: Sedat Dilek @ 2013-07-03 12:19 UTC (permalink / raw)
  To: davem, netdev, linux-kernel, lizefan, akpm, linux-next, sfr,
	linux-mm
  Cc: Sedat Dilek

When "CONFIG_MEMCG_KMEM=n" I see this in my build-log:

 LD      init/built-in.o
mm/built-in.o: In function `mem_cgroup_css_free':
memcontrol.c:(.text+0x5caa6): undefined reference to `mem_cgroup_sockets_destroy'
make[2]: *** [vmlinux] Error 1

Inspired by the ifdef for mem_cgroup_sockets_{init,destroy} here...

[ net/core/sock.c ]

 #ifdef CONFIG_MEMCG_KMEM
 int mem_cgroup_sockets_init()
 ...
 void mem_cgroup_sockets_destroy()
 ...
 #endif

...I did the the same for both in "include/net/sock.h".

This fixes the issue for me in next-20130703.

Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com>
---
[ v2: git dislikes lines beginning with hash ('#'). ]

 include/net/sock.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/net/sock.h b/include/net/sock.h
index ea6206c..ad4bf7f 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -71,6 +71,7 @@
 struct cgroup;
 struct cgroup_subsys;
 #ifdef CONFIG_NET
+#ifdef CONFIG_MEMCG_KMEM
 int mem_cgroup_sockets_init(struct mem_cgroup *memcg, struct cgroup_subsys *ss);
 void mem_cgroup_sockets_destroy(struct mem_cgroup *memcg);
 #else
@@ -83,7 +84,8 @@ static inline
 void mem_cgroup_sockets_destroy(struct mem_cgroup *memcg)
 {
 }
-#endif
+#endif /* CONFIG_NET */
+#endif /* CONFIG_MEMCG_KMEM */
 /*
  * This structure really needs to be cleaned up.
  * Most of it is for TCP, and not used by any of
-- 
1.8.3.2

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 14+ messages in thread
* [PATCH next-20130703] net: sock: Add ifdef CONFIG_MEMCG_KMEM for mem_cgroup_sockets_{init,destroy}
@ 2013-07-03 12:49 Sedat Dilek
  0 siblings, 0 replies; 14+ messages in thread
From: Sedat Dilek @ 2013-07-03 12:49 UTC (permalink / raw)
  To: David S. Miller, netdev, linux-kernel, Li Zefan, Andrew Morton,
	linux-next, Stephen Rothwell, linux-mm, Sergei Shtylyov
  Cc: Sedat Dilek

When "CONFIG_MEMCG_KMEM=n" I see this in my build-log:

 LD      init/built-in.o
mm/built-in.o: In function `mem_cgroup_css_free':
memcontrol.c:(.text+0x5caa6): undefined reference to `mem_cgroup_sockets_destroy'
make[2]: *** [vmlinux] Error 1

Inspired by the ifdef for mem_cgroup_sockets_{init,destroy} here...

[ net/core/sock.c ]

 #ifdef CONFIG_MEMCG_KMEM
 int mem_cgroup_sockets_init()
 ...
 void mem_cgroup_sockets_destroy()
 ...
 #endif

...I did the the same for both in "include/net/sock.h".

This fixes the issue for me in next-20130703.

Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com>
---
v3: Mixed up the order of comments: CONFIG_NET should come last.
    (Thanks Sergei Shtylyov)
v2: git dislikes lines beginning with hash ('#') in the changelog.

Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com>
---
 include/net/sock.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/net/sock.h b/include/net/sock.h
index ea6206c..37d2374 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -71,6 +71,7 @@
 struct cgroup;
 struct cgroup_subsys;
 #ifdef CONFIG_NET
+#ifdef CONFIG_MEMCG_KMEM
 int mem_cgroup_sockets_init(struct mem_cgroup *memcg, struct cgroup_subsys *ss);
 void mem_cgroup_sockets_destroy(struct mem_cgroup *memcg);
 #else
@@ -83,7 +84,8 @@ static inline
 void mem_cgroup_sockets_destroy(struct mem_cgroup *memcg)
 {
 }
-#endif
+#endif /* CONFIG_MEMCG_KMEM */
+#endif /* CONFIG_NET */
 /*
  * This structure really needs to be cleaned up.
  * Most of it is for TCP, and not used by any of
-- 
1.8.3.2

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2013-07-03 16:42 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-03 12:14 [PATCH next-20130703] net: sock: Add ifdef CONFIG_MEMCG_KMEM for mem_cgroup_sockets_{init,destroy} Sedat Dilek
2013-07-03 12:40 ` Sergei Shtylyov
  -- strict thread matches above, loose matches on Subject: below --
2013-07-03 12:19 Sedat Dilek
2013-07-03 12:51 ` Li Zefan
2013-07-03 13:09   ` Sedat Dilek
2013-07-03 13:10     ` Sedat Dilek
2013-07-03 13:20   ` Sedat Dilek
2013-07-03 15:20   ` Michal Hocko
2013-07-03 15:53     ` Sedat Dilek
2013-07-03 15:59       ` Michal Hocko
2013-07-03 16:11         ` Sedat Dilek
2013-07-03 16:34           ` Michal Hocko
2013-07-03 16:42             ` Sedat Dilek
2013-07-03 12:49 Sedat Dilek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).