All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Zefan <lizefan@huawei.com>
To: Sedat Dilek <sedat.dilek@gmail.com>, akpm@linux-foundation.org
Cc: davem@davemloft.net, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-next@vger.kernel.org,
	sfr@canb.auug.org.au, linux-mm@kvack.org
Subject: Re: [PATCH next-20130703] net: sock: Add ifdef CONFIG_MEMCG_KMEM for mem_cgroup_sockets_{init,destroy}
Date: Wed, 3 Jul 2013 20:51:00 +0800	[thread overview]
Message-ID: <51D41E34.5010802@huawei.com> (raw)
In-Reply-To: <1372853998-15353-1-git-send-email-sedat.dilek@gmail.com>

On 2013/7/3 20:19, Sedat Dilek wrote:
> 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>

Maybe it's better to add memcg_destroy_kmem(), to pair with
memcg_init_kmem().

This patch can be folded into "memcg: use css_get/put when charging/uncharging kmem"

=======================

[PATCH] memcg: fix build error if CONFIG_MEMCG_KMEM=n

Fix this build error:

mm/built-in.o: In function `mem_cgroup_css_free':
memcontrol.c:(.text+0x5caa6): undefined reference to
'mem_cgroup_sockets_destroy'

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Li Zefan <lizefan@huawei.com>
---
 mm/memcontrol.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 234f311..59ea6f9 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -5876,6 +5876,11 @@ static int memcg_init_kmem(struct mem_cgroup *memcg, struct cgroup_subsys *ss)
 	return mem_cgroup_sockets_init(memcg, ss);
 }
 
+static void memcg_destroy_kmem(struct mem_cgroup *memcg)
+{
+	mem_cgroup_sockets_destroy(memcg);
+}
+
 static void kmem_cgroup_css_offline(struct mem_cgroup *memcg)
 {
 	if (!memcg_kmem_is_active(memcg))
@@ -5915,6 +5920,10 @@ static int memcg_init_kmem(struct mem_cgroup *memcg, struct cgroup_subsys *ss)
 	return 0;
 }
 
+static void memcg_destroy_kmem(struct mem_cgroup *memcg)
+{
+}
+
 static void kmem_cgroup_css_offline(struct mem_cgroup *memcg)
 {
 }
@@ -6312,8 +6321,7 @@ static void mem_cgroup_css_free(struct cgroup *cont)
 {
 	struct mem_cgroup *memcg = mem_cgroup_from_cont(cont);
 
-	mem_cgroup_sockets_destroy(memcg);
-
+	memcg_destroy_kmem(memcg);
 	__mem_cgroup_free(memcg);
 }
 
-- 
1.8.0.2


> ---
> [ 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

#if defined(CONFIG_NET) && defined(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
> 

WARNING: multiple messages have this Message-ID (diff)
From: Li Zefan <lizefan@huawei.com>
To: Sedat Dilek <sedat.dilek@gmail.com>, akpm@linux-foundation.org
Cc: davem@davemloft.net, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-next@vger.kernel.org,
	sfr@canb.auug.org.au, linux-mm@kvack.org
Subject: Re: [PATCH next-20130703] net: sock: Add ifdef CONFIG_MEMCG_KMEM for mem_cgroup_sockets_{init,destroy}
Date: Wed, 3 Jul 2013 20:51:00 +0800	[thread overview]
Message-ID: <51D41E34.5010802@huawei.com> (raw)
In-Reply-To: <1372853998-15353-1-git-send-email-sedat.dilek@gmail.com>

On 2013/7/3 20:19, Sedat Dilek wrote:
> 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>

Maybe it's better to add memcg_destroy_kmem(), to pair with
memcg_init_kmem().

This patch can be folded into "memcg: use css_get/put when charging/uncharging kmem"

=======================

[PATCH] memcg: fix build error if CONFIG_MEMCG_KMEM=n

Fix this build error:

mm/built-in.o: In function `mem_cgroup_css_free':
memcontrol.c:(.text+0x5caa6): undefined reference to
'mem_cgroup_sockets_destroy'

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Li Zefan <lizefan@huawei.com>
---
 mm/memcontrol.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 234f311..59ea6f9 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -5876,6 +5876,11 @@ static int memcg_init_kmem(struct mem_cgroup *memcg, struct cgroup_subsys *ss)
 	return mem_cgroup_sockets_init(memcg, ss);
 }
 
+static void memcg_destroy_kmem(struct mem_cgroup *memcg)
+{
+	mem_cgroup_sockets_destroy(memcg);
+}
+
 static void kmem_cgroup_css_offline(struct mem_cgroup *memcg)
 {
 	if (!memcg_kmem_is_active(memcg))
@@ -5915,6 +5920,10 @@ static int memcg_init_kmem(struct mem_cgroup *memcg, struct cgroup_subsys *ss)
 	return 0;
 }
 
+static void memcg_destroy_kmem(struct mem_cgroup *memcg)
+{
+}
+
 static void kmem_cgroup_css_offline(struct mem_cgroup *memcg)
 {
 }
@@ -6312,8 +6321,7 @@ static void mem_cgroup_css_free(struct cgroup *cont)
 {
 	struct mem_cgroup *memcg = mem_cgroup_from_cont(cont);
 
-	mem_cgroup_sockets_destroy(memcg);
-
+	memcg_destroy_kmem(memcg);
 	__mem_cgroup_free(memcg);
 }
 
-- 
1.8.0.2


> ---
> [ 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

#if defined(CONFIG_NET) && defined(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
> 

--
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>

WARNING: multiple messages have this Message-ID (diff)
From: Li Zefan <lizefan@huawei.com>
To: Sedat Dilek <sedat.dilek@gmail.com>, <akpm@linux-foundation.org>
Cc: <davem@davemloft.net>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <linux-next@vger.kernel.org>,
	<sfr@canb.auug.org.au>, <linux-mm@kvack.org>
Subject: Re: [PATCH next-20130703] net: sock: Add ifdef CONFIG_MEMCG_KMEM for mem_cgroup_sockets_{init,destroy}
Date: Wed, 3 Jul 2013 20:51:00 +0800	[thread overview]
Message-ID: <51D41E34.5010802@huawei.com> (raw)
In-Reply-To: <1372853998-15353-1-git-send-email-sedat.dilek@gmail.com>

On 2013/7/3 20:19, Sedat Dilek wrote:
> 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>

Maybe it's better to add memcg_destroy_kmem(), to pair with
memcg_init_kmem().

This patch can be folded into "memcg: use css_get/put when charging/uncharging kmem"

=======================

[PATCH] memcg: fix build error if CONFIG_MEMCG_KMEM=n

Fix this build error:

mm/built-in.o: In function `mem_cgroup_css_free':
memcontrol.c:(.text+0x5caa6): undefined reference to
'mem_cgroup_sockets_destroy'

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Li Zefan <lizefan@huawei.com>
---
 mm/memcontrol.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 234f311..59ea6f9 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -5876,6 +5876,11 @@ static int memcg_init_kmem(struct mem_cgroup *memcg, struct cgroup_subsys *ss)
 	return mem_cgroup_sockets_init(memcg, ss);
 }
 
+static void memcg_destroy_kmem(struct mem_cgroup *memcg)
+{
+	mem_cgroup_sockets_destroy(memcg);
+}
+
 static void kmem_cgroup_css_offline(struct mem_cgroup *memcg)
 {
 	if (!memcg_kmem_is_active(memcg))
@@ -5915,6 +5920,10 @@ static int memcg_init_kmem(struct mem_cgroup *memcg, struct cgroup_subsys *ss)
 	return 0;
 }
 
+static void memcg_destroy_kmem(struct mem_cgroup *memcg)
+{
+}
+
 static void kmem_cgroup_css_offline(struct mem_cgroup *memcg)
 {
 }
@@ -6312,8 +6321,7 @@ static void mem_cgroup_css_free(struct cgroup *cont)
 {
 	struct mem_cgroup *memcg = mem_cgroup_from_cont(cont);
 
-	mem_cgroup_sockets_destroy(memcg);
-
+	memcg_destroy_kmem(memcg);
 	__mem_cgroup_free(memcg);
 }
 
-- 
1.8.0.2


> ---
> [ 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

#if defined(CONFIG_NET) && defined(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
> 


  reply	other threads:[~2013-07-03 12:51 UTC|newest]

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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51D41E34.5010802@huawei.com \
    --to=lizefan@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-next@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sedat.dilek@gmail.com \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.