From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx158.postini.com [74.125.245.158]) by kanga.kvack.org (Postfix) with SMTP id 260966B01FE for ; Fri, 14 Sep 2012 07:21:21 -0400 (EDT) Date: Fri, 14 Sep 2012 13:21:18 +0200 From: Michal Hocko Subject: [PATCH v2] memcg: clean up networking headers file inclusion Message-ID: <20120914112118.GG28039@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: owner-linux-mm@kvack.org List-ID: To: Andrew Morton , Glauber Costa Cc: linux-mm@kvack.org, Sachin Kamat Hi, so I did some more changes to ifdefery of sock kmem part. The patch is below. Glauber please have a look at it. I do not think any of the functionality wrapped inside CONFIG_MEMCG_KMEM without CONFIG_INET is reusable for generic CONFIG_MEMCG_KMEM, right? --- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx202.postini.com [74.125.245.202]) by kanga.kvack.org (Postfix) with SMTP id BA3366B0201 for ; Fri, 14 Sep 2012 07:24:49 -0400 (EDT) Message-ID: <50531339.1000805@parallels.com> Date: Fri, 14 Sep 2012 15:21:29 +0400 From: Glauber Costa MIME-Version: 1.0 Subject: Re: [PATCH v2] memcg: clean up networking headers file inclusion References: <20120914112118.GG28039@dhcp22.suse.cz> In-Reply-To: <20120914112118.GG28039@dhcp22.suse.cz> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Michal Hocko Cc: Andrew Morton , linux-mm@kvack.org, Sachin Kamat On 09/14/2012 03:21 PM, Michal Hocko wrote: > Hi, > so I did some more changes to ifdefery of sock kmem part. The patch is > below. > Glauber please have a look at it. I do not think any of the > functionality wrapped inside CONFIG_MEMCG_KMEM without CONFIG_INET is > reusable for generic CONFIG_MEMCG_KMEM, right? Almost right. > } > > /* Writing them here to avoid exposing memcg's inner layout */ > -#ifdef CONFIG_MEMCG_KMEM > -#include > -#include > +#if defined(CONFIG_INET) && defined(CONFIG_MEMCG_KMEM) > > static bool mem_cgroup_is_root(struct mem_cgroup *memcg); This one is. ^^^^ -- 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: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx180.postini.com [74.125.245.180]) by kanga.kvack.org (Postfix) with SMTP id E46026B0205 for ; Fri, 14 Sep 2012 07:34:02 -0400 (EDT) Date: Fri, 14 Sep 2012 13:34:00 +0200 From: Michal Hocko Subject: Re: [PATCH v2] memcg: clean up networking headers file inclusion Message-ID: <20120914113400.GI28039@dhcp22.suse.cz> References: <20120914112118.GG28039@dhcp22.suse.cz> <50531339.1000805@parallels.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <50531339.1000805@parallels.com> Sender: owner-linux-mm@kvack.org List-ID: To: Glauber Costa Cc: Andrew Morton , linux-mm@kvack.org, Sachin Kamat On Fri 14-09-12 15:21:29, Glauber Costa wrote: > On 09/14/2012 03:21 PM, Michal Hocko wrote: > > Hi, > > so I did some more changes to ifdefery of sock kmem part. The patch is > > below. > > Glauber please have a look at it. I do not think any of the > > functionality wrapped inside CONFIG_MEMCG_KMEM without CONFIG_INET is > > reusable for generic CONFIG_MEMCG_KMEM, right? > Almost right. > > > > > } > > > > /* Writing them here to avoid exposing memcg's inner layout */ > > -#ifdef CONFIG_MEMCG_KMEM > > -#include > > -#include > > +#if defined(CONFIG_INET) && defined(CONFIG_MEMCG_KMEM) > > > > static bool mem_cgroup_is_root(struct mem_cgroup *memcg); > > This one is. ^^^^ But this is just a forward declaration. And btw. it makes my compiler complain about: mm/memcontrol.c:421: warning: a??mem_cgroup_is_roota?? declared inline after being called mm/memcontrol.c:421: warning: previous declaration of a??mem_cgroup_is_roota?? was here But I didn't care much yet. It is probaly that my compiler is too old to be clever about this. -- Michal Hocko SUSE Labs -- 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: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx140.postini.com [74.125.245.140]) by kanga.kvack.org (Postfix) with SMTP id E2C4C6B0206 for ; Fri, 14 Sep 2012 07:39:07 -0400 (EDT) Message-ID: <50531696.1080708@parallels.com> Date: Fri, 14 Sep 2012 15:35:50 +0400 From: Glauber Costa MIME-Version: 1.0 Subject: Re: [PATCH v2] memcg: clean up networking headers file inclusion References: <20120914112118.GG28039@dhcp22.suse.cz> <50531339.1000805@parallels.com> <20120914113400.GI28039@dhcp22.suse.cz> In-Reply-To: <20120914113400.GI28039@dhcp22.suse.cz> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: owner-linux-mm@kvack.org List-ID: To: Michal Hocko Cc: Andrew Morton , linux-mm@kvack.org, Sachin Kamat On 09/14/2012 03:34 PM, Michal Hocko wrote: > On Fri 14-09-12 15:21:29, Glauber Costa wrote: >> On 09/14/2012 03:21 PM, Michal Hocko wrote: >>> Hi, >>> so I did some more changes to ifdefery of sock kmem part. The patch is >>> below.=20 >>> Glauber please have a look at it. I do not think any of the >>> functionality wrapped inside CONFIG_MEMCG_KMEM without CONFIG_INET is >>> reusable for generic CONFIG_MEMCG_KMEM, right? >> Almost right. >> >> >> >>> } >>> =20 >>> /* Writing them here to avoid exposing memcg's inner layout */ >>> -#ifdef CONFIG_MEMCG_KMEM >>> -#include >>> -#include >>> +#if defined(CONFIG_INET) && defined(CONFIG_MEMCG_KMEM) >>> =20 >>> static bool mem_cgroup_is_root(struct mem_cgroup *memcg); >> >> This one is. ^^^^ >=20 > But this is just a forward declaration. And btw. it makes my compiler > complain about: > mm/memcontrol.c:421: warning: =E2=80=98mem_cgroup_is_root=E2=80=99 declar= ed inline after being called > mm/memcontrol.c:421: warning: previous declaration of =E2=80=98mem_cgroup= _is_root=E2=80=99 was here >=20 > But I didn't care much yet. It is probaly that my compiler is too old to > be clever about this. >=20 Weird, this code is in tree for a long time. So, *right now* this code is used only for inet code, so I won't oppose your patch on this basis. I'll reuse it for kmem, but I am happy to just rebase it. -- 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: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx152.postini.com [74.125.245.152]) by kanga.kvack.org (Postfix) with SMTP id BA2646B0208 for ; Fri, 14 Sep 2012 08:01:41 -0400 (EDT) Date: Fri, 14 Sep 2012 14:01:39 +0200 From: Michal Hocko Subject: Re: [PATCH v2] memcg: clean up networking headers file inclusion Message-ID: <20120914120138.GK28039@dhcp22.suse.cz> References: <20120914112118.GG28039@dhcp22.suse.cz> <50531339.1000805@parallels.com> <20120914113400.GI28039@dhcp22.suse.cz> <50531696.1080708@parallels.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <50531696.1080708@parallels.com> Sender: owner-linux-mm@kvack.org List-ID: To: Glauber Costa Cc: Andrew Morton , linux-mm@kvack.org, Sachin Kamat On Fri 14-09-12 15:35:50, Glauber Costa wrote: > On 09/14/2012 03:34 PM, Michal Hocko wrote: > > On Fri 14-09-12 15:21:29, Glauber Costa wrote: > >> On 09/14/2012 03:21 PM, Michal Hocko wrote: > >>> Hi, > >>> so I did some more changes to ifdefery of sock kmem part. The patch is > >>> below. > >>> Glauber please have a look at it. I do not think any of the > >>> functionality wrapped inside CONFIG_MEMCG_KMEM without CONFIG_INET is > >>> reusable for generic CONFIG_MEMCG_KMEM, right? > >> Almost right. > >> > >> > >> > >>> } > >>> > >>> /* Writing them here to avoid exposing memcg's inner layout */ > >>> -#ifdef CONFIG_MEMCG_KMEM > >>> -#include > >>> -#include > >>> +#if defined(CONFIG_INET) && defined(CONFIG_MEMCG_KMEM) > >>> > >>> static bool mem_cgroup_is_root(struct mem_cgroup *memcg); > >> > >> This one is. ^^^^ > > > > But this is just a forward declaration. And btw. it makes my compiler > > complain about: > > mm/memcontrol.c:421: warning: a??mem_cgroup_is_roota?? declared inline after being called > > mm/memcontrol.c:421: warning: previous declaration of a??mem_cgroup_is_roota?? was here > > > > But I didn't care much yet. It is probaly that my compiler is too old to > > be clever about this. > > > Weird, this code is in tree for a long time. Yes I think it is just compiler issue. Anyway the trivial patch bellow does the trick. --- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx101.postini.com [74.125.245.101]) by kanga.kvack.org (Postfix) with SMTP id CD78E6B020B for ; Fri, 14 Sep 2012 08:08:51 -0400 (EDT) Date: Fri, 14 Sep 2012 14:08:49 +0200 From: Michal Hocko Subject: [PATCH v3] memcg: clean up networking headers file inclusion Message-ID: <20120914120849.GL28039@dhcp22.suse.cz> References: <20120914112118.GG28039@dhcp22.suse.cz> <50531339.1000805@parallels.com> <20120914113400.GI28039@dhcp22.suse.cz> <50531696.1080708@parallels.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <50531696.1080708@parallels.com> Sender: owner-linux-mm@kvack.org List-ID: To: Glauber Costa Cc: Andrew Morton , linux-mm@kvack.org, Sachin Kamat On Fri 14-09-12 15:35:50, Glauber Costa wrote: [...] > So, *right now* this code is used only for inet code, so I won't oppose > your patch on this basis. I'll reuse it for kmem, but I am happy to just > rebase it. Hmm, I guess I was too strict after all. memcg_init_kmem doesn't need CONFIG_INET gueard as both mem_cgroup_sockets_{init,destroy} are defined empty for !CONFIG_INET. All other functions guarded in INET&&KMEM combo seem to be networking specific. Updated patch bellow: --- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx143.postini.com [74.125.245.143]) by kanga.kvack.org (Postfix) with SMTP id E31AC6B020C for ; Fri, 14 Sep 2012 08:08:54 -0400 (EDT) Message-ID: <5052E550.9000506@parallels.com> Date: Fri, 14 Sep 2012 12:05:36 +0400 From: Glauber Costa MIME-Version: 1.0 Subject: Re: [PATCH v2] memcg: clean up networking headers file inclusion References: <20120914112118.GG28039@dhcp22.suse.cz> <50531339.1000805@parallels.com> <20120914113400.GI28039@dhcp22.suse.cz> <50531696.1080708@parallels.com> <20120914120138.GK28039@dhcp22.suse.cz> In-Reply-To: <20120914120138.GK28039@dhcp22.suse.cz> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: owner-linux-mm@kvack.org List-ID: To: Michal Hocko Cc: Andrew Morton , linux-mm@kvack.org, Sachin Kamat On 09/14/2012 04:01 PM, Michal Hocko wrote: > On Fri 14-09-12 15:35:50, Glauber Costa wrote: >> On 09/14/2012 03:34 PM, Michal Hocko wrote: >>> On Fri 14-09-12 15:21:29, Glauber Costa wrote: >>>> On 09/14/2012 03:21 PM, Michal Hocko wrote: >>>>> Hi, >>>>> so I did some more changes to ifdefery of sock kmem part. The patch i= s >>>>> below.=20 >>>>> Glauber please have a look at it. I do not think any of the >>>>> functionality wrapped inside CONFIG_MEMCG_KMEM without CONFIG_INET is >>>>> reusable for generic CONFIG_MEMCG_KMEM, right? >>>> Almost right. >>>> >>>> >>>> >>>>> } >>>>> =20 >>>>> /* Writing them here to avoid exposing memcg's inner layout */ >>>>> -#ifdef CONFIG_MEMCG_KMEM >>>>> -#include >>>>> -#include >>>>> +#if defined(CONFIG_INET) && defined(CONFIG_MEMCG_KMEM) >>>>> =20 >>>>> static bool mem_cgroup_is_root(struct mem_cgroup *memcg); >>>> >>>> This one is. ^^^^ >>> >>> But this is just a forward declaration. And btw. it makes my compiler >>> complain about: >>> mm/memcontrol.c:421: warning: =E2=80=98mem_cgroup_is_root=E2=80=99 decl= ared inline after being called >>> mm/memcontrol.c:421: warning: previous declaration of =E2=80=98mem_cgro= up_is_root=E2=80=99 was here >>> >>> But I didn't care much yet. It is probaly that my compiler is too old t= o >>> be clever about this. >>> >> Weird, this code is in tree for a long time. >=20 > Yes I think it is just compiler issue. Anyway the trivial patch bellow > does the trick. That seems to be alright, and it works for me as well. > --- > From 28a803e6e07c5b7ae6b88d7b26801666781aa899 Mon Sep 17 00:00:00 2001 > From: Michal Hocko > Date: Fri, 14 Sep 2012 13:56:32 +0200 > Subject: [PATCH] memcg: move mem_cgroup_is_root upwards > MIME-Version: 1.0 > Content-Type: text/plain; charset=3DUTF-8 > Content-Transfer-Encoding: 8bit >=20 > kmem code uses this function and it is better to not use forward > declarations for static inline functions as some (older) compilers don't > like it: >=20 > gcc version 4.3.4 [gcc-4_3-branch revision 152973] (SUSE Linux) >=20 > mm/memcontrol.c:421: warning: =E2=80=98mem_cgroup_is_root=E2=80=99 declar= ed inline after being called > mm/memcontrol.c:421: warning: previous declaration of =E2=80=98mem_cgroup= _is_root=E2=80=99 was here >=20 > Signed-off-by: Michal Hocko > --- > mm/memcontrol.c | 11 +++++------ > 1 file changed, 5 insertions(+), 6 deletions(-) >=20 > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index 0cd25e9..df69552 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -415,10 +415,14 @@ struct mem_cgroup *mem_cgroup_from_css(struct cgrou= p_subsys_state *s) > return container_of(s, struct mem_cgroup, css); > } > =20 > +static inline bool mem_cgroup_is_root(struct mem_cgroup *memcg) > +{ > + return (memcg =3D=3D root_mem_cgroup); > +} > + > /* Writing them here to avoid exposing memcg's inner layout */ > #if defined(CONFIG_INET) && defined(CONFIG_MEMCG_KMEM) > =20 > -static bool mem_cgroup_is_root(struct mem_cgroup *memcg); > void sock_update_memcg(struct sock *sk) > { > if (mem_cgroup_sockets_enabled) { > @@ -1014,11 +1018,6 @@ void mem_cgroup_iter_break(struct mem_cgroup *root= , > iter !=3D NULL; \ > iter =3D mem_cgroup_iter(NULL, iter, NULL)) > =20 > -static inline bool mem_cgroup_is_root(struct mem_cgroup *memcg) > -{ > - return (memcg =3D=3D root_mem_cgroup); > -} > - > void mem_cgroup_count_vm_event(struct mm_struct *mm, enum vm_event_item = idx) > { > struct mem_cgroup *memcg; >=20 -- 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: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx135.postini.com [74.125.245.135]) by kanga.kvack.org (Postfix) with SMTP id 438DA6B020E for ; Fri, 14 Sep 2012 08:13:12 -0400 (EDT) Date: Fri, 14 Sep 2012 14:13:09 +0200 From: Michal Hocko Subject: Re: [PATCH v2] memcg: clean up networking headers file inclusion Message-ID: <20120914121309.GM28039@dhcp22.suse.cz> References: <20120914112118.GG28039@dhcp22.suse.cz> <50531339.1000805@parallels.com> <20120914113400.GI28039@dhcp22.suse.cz> <50531696.1080708@parallels.com> <20120914120138.GK28039@dhcp22.suse.cz> <5052E550.9000506@parallels.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5052E550.9000506@parallels.com> Sender: owner-linux-mm@kvack.org List-ID: To: Glauber Costa Cc: Andrew Morton , linux-mm@kvack.org, Sachin Kamat On Fri 14-09-12 12:05:36, Glauber Costa wrote: > On 09/14/2012 04:01 PM, Michal Hocko wrote: > > On Fri 14-09-12 15:35:50, Glauber Costa wrote: > >> On 09/14/2012 03:34 PM, Michal Hocko wrote: > >>> On Fri 14-09-12 15:21:29, Glauber Costa wrote: > >>>> On 09/14/2012 03:21 PM, Michal Hocko wrote: > >>>>> Hi, > >>>>> so I did some more changes to ifdefery of sock kmem part. The patch is > >>>>> below. > >>>>> Glauber please have a look at it. I do not think any of the > >>>>> functionality wrapped inside CONFIG_MEMCG_KMEM without CONFIG_INET is > >>>>> reusable for generic CONFIG_MEMCG_KMEM, right? > >>>> Almost right. > >>>> > >>>> > >>>> > >>>>> } > >>>>> > >>>>> /* Writing them here to avoid exposing memcg's inner layout */ > >>>>> -#ifdef CONFIG_MEMCG_KMEM > >>>>> -#include > >>>>> -#include > >>>>> +#if defined(CONFIG_INET) && defined(CONFIG_MEMCG_KMEM) > >>>>> > >>>>> static bool mem_cgroup_is_root(struct mem_cgroup *memcg); > >>>> > >>>> This one is. ^^^^ > >>> > >>> But this is just a forward declaration. And btw. it makes my compiler > >>> complain about: > >>> mm/memcontrol.c:421: warning: a??mem_cgroup_is_roota?? declared inline after being called > >>> mm/memcontrol.c:421: warning: previous declaration of a??mem_cgroup_is_roota?? was here > >>> > >>> But I didn't care much yet. It is probaly that my compiler is too old to > >>> be clever about this. > >>> > >> Weird, this code is in tree for a long time. > > > > Yes I think it is just compiler issue. Anyway the trivial patch bellow > > does the trick. > > That seems to be alright, and it works for me as well. OK, I will post it on top of the last version. > > > > --- > > From 28a803e6e07c5b7ae6b88d7b26801666781aa899 Mon Sep 17 00:00:00 2001 > > From: Michal Hocko > > Date: Fri, 14 Sep 2012 13:56:32 +0200 > > Subject: [PATCH] memcg: move mem_cgroup_is_root upwards > > MIME-Version: 1.0 > > Content-Type: text/plain; charset=UTF-8 > > Content-Transfer-Encoding: 8bit > > > > kmem code uses this function and it is better to not use forward > > declarations for static inline functions as some (older) compilers don't > > like it: > > > > gcc version 4.3.4 [gcc-4_3-branch revision 152973] (SUSE Linux) > > > > mm/memcontrol.c:421: warning: a??mem_cgroup_is_roota?? declared inline after being called > > mm/memcontrol.c:421: warning: previous declaration of a??mem_cgroup_is_roota?? was here > > > > Signed-off-by: Michal Hocko > > --- > > mm/memcontrol.c | 11 +++++------ > > 1 file changed, 5 insertions(+), 6 deletions(-) > > > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > > index 0cd25e9..df69552 100644 > > --- a/mm/memcontrol.c > > +++ b/mm/memcontrol.c > > @@ -415,10 +415,14 @@ struct mem_cgroup *mem_cgroup_from_css(struct cgroup_subsys_state *s) > > return container_of(s, struct mem_cgroup, css); > > } > > > > +static inline bool mem_cgroup_is_root(struct mem_cgroup *memcg) > > +{ > > + return (memcg == root_mem_cgroup); > > +} > > + > > /* Writing them here to avoid exposing memcg's inner layout */ > > #if defined(CONFIG_INET) && defined(CONFIG_MEMCG_KMEM) > > > > -static bool mem_cgroup_is_root(struct mem_cgroup *memcg); > > void sock_update_memcg(struct sock *sk) > > { > > if (mem_cgroup_sockets_enabled) { > > @@ -1014,11 +1018,6 @@ void mem_cgroup_iter_break(struct mem_cgroup *root, > > iter != NULL; \ > > iter = mem_cgroup_iter(NULL, iter, NULL)) > > > > -static inline bool mem_cgroup_is_root(struct mem_cgroup *memcg) > > -{ > > - return (memcg == root_mem_cgroup); > > -} > > - > > void mem_cgroup_count_vm_event(struct mm_struct *mm, enum vm_event_item idx) > > { > > struct mem_cgroup *memcg; > > > -- Michal Hocko SUSE Labs -- 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: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx186.postini.com [74.125.245.186]) by kanga.kvack.org (Postfix) with SMTP id CDF726B0248 for ; Fri, 14 Sep 2012 08:17:48 -0400 (EDT) Message-ID: <5052E766.9070304@parallels.com> Date: Fri, 14 Sep 2012 12:14:30 +0400 From: Glauber Costa MIME-Version: 1.0 Subject: Re: [PATCH v3] memcg: clean up networking headers file inclusion References: <20120914112118.GG28039@dhcp22.suse.cz> <50531339.1000805@parallels.com> <20120914113400.GI28039@dhcp22.suse.cz> <50531696.1080708@parallels.com> <20120914120849.GL28039@dhcp22.suse.cz> In-Reply-To: <20120914120849.GL28039@dhcp22.suse.cz> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Michal Hocko Cc: Andrew Morton , linux-mm@kvack.org, Sachin Kamat On 09/14/2012 04:08 PM, Michal Hocko wrote: > On Fri 14-09-12 15:35:50, Glauber Costa wrote: > [...] >> So, *right now* this code is used only for inet code, so I won't oppose >> your patch on this basis. I'll reuse it for kmem, but I am happy to just >> rebase it. > > Hmm, I guess I was too strict after all. memcg_init_kmem doesn't need > CONFIG_INET gueard as both mem_cgroup_sockets_{init,destroy} are defined > empty for !CONFIG_INET. All other functions guarded in INET&&KMEM combo > seem to be networking specific. > Updated patch bellow: > --- > From 4dca5e135b4dcc08464bbd70761d094f99ed83b1 Mon Sep 17 00:00:00 2001 > From: Michal Hocko > Date: Tue, 11 Sep 2012 10:38:42 +0200 > Subject: [PATCH] memcg: clean up networking headers file inclusion > > Memory controller doesn't need anything from the networking stack unless > CONFIG_MEMCG_KMEM is selected. > Now we are including net/sock.h and net/tcp_memcontrol.h unconditionally > which is not necessary. Moreover struct mem_cgroup contains tcp_mem > even if CONFIG_MEMCG_KMEM and CONFIG_INET are not selected which is not > necessary. > While we are at it, let's clean up KMEM sock code ifdefs to require both > CONFIG_KMEM and CONFIG_INET as it doesn't make much sense to compile > this code if there is no possible user for it. > > Tested with > - CONFIG_INET && CONFIG_MEMCG_KMEM > - !CONFIG_INET && CONFIG_MEMCG_KMEM > - CONFIG_INET && !CONFIG_MEMCG_KMEM > - !CONFIG_INET && !CONFIG_MEMCG_KMEM > > Changes since V2: > - memcg_init_kmem and kmem_cgroup_destroy don't need CONFIG_INET > > Changes since V1: > - depend on both CONFIG_INET and CONFIG_MEMCG_KMEM for both > mem_cgroup->tcp_mem and the sock specific code > > Signed-off-by: Sachin Kamat > Signed-off-by: Michal Hocko Seems safe now. Since the config matrix can get tricky, and we have no pressing time issues with this, I would advise to give it a day in Fengguang's magic system before merging it. Just put it in a temp branch in korg and let it do the job. -- 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: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx133.postini.com [74.125.245.133]) by kanga.kvack.org (Postfix) with SMTP id 5308F6B024A for ; Fri, 14 Sep 2012 08:18:15 -0400 (EDT) Date: Fri, 14 Sep 2012 14:18:13 +0200 From: Michal Hocko Subject: [PATCH] memcg: clean up networking headers file inclusion Message-ID: <20120914121813.GN28039@dhcp22.suse.cz> References: <20120914112118.GG28039@dhcp22.suse.cz> <50531339.1000805@parallels.com> <20120914113400.GI28039@dhcp22.suse.cz> <50531696.1080708@parallels.com> <20120914120849.GL28039@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20120914120849.GL28039@dhcp22.suse.cz> Sender: owner-linux-mm@kvack.org List-ID: To: Glauber Costa Cc: Andrew Morton , linux-mm@kvack.org, Sachin Kamat And here is another trivial patch on top of the previous patch. I am not sure whether we care about such old compilers but the change itself makes some sense on its own. --- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx140.postini.com [74.125.245.140]) by kanga.kvack.org (Postfix) with SMTP id 7C8AE6B024C for ; Fri, 14 Sep 2012 08:24:16 -0400 (EDT) Date: Fri, 14 Sep 2012 14:24:13 +0200 From: Michal Hocko Subject: Re: [PATCH v3] memcg: clean up networking headers file inclusion Message-ID: <20120914122413.GO28039@dhcp22.suse.cz> References: <20120914112118.GG28039@dhcp22.suse.cz> <50531339.1000805@parallels.com> <20120914113400.GI28039@dhcp22.suse.cz> <50531696.1080708@parallels.com> <20120914120849.GL28039@dhcp22.suse.cz> <5052E766.9070304@parallels.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5052E766.9070304@parallels.com> Sender: owner-linux-mm@kvack.org List-ID: To: Glauber Costa , Wu Fengguang Cc: Andrew Morton , linux-mm@kvack.org, Sachin Kamat On Fri 14-09-12 12:14:30, Glauber Costa wrote: > On 09/14/2012 04:08 PM, Michal Hocko wrote: > > On Fri 14-09-12 15:35:50, Glauber Costa wrote: > > [...] > >> So, *right now* this code is used only for inet code, so I won't oppose > >> your patch on this basis. I'll reuse it for kmem, but I am happy to just > >> rebase it. > > > > Hmm, I guess I was too strict after all. memcg_init_kmem doesn't need > > CONFIG_INET gueard as both mem_cgroup_sockets_{init,destroy} are defined > > empty for !CONFIG_INET. All other functions guarded in INET&&KMEM combo > > seem to be networking specific. > > Updated patch bellow: > > --- > > From 4dca5e135b4dcc08464bbd70761d094f99ed83b1 Mon Sep 17 00:00:00 2001 > > From: Michal Hocko > > Date: Tue, 11 Sep 2012 10:38:42 +0200 > > Subject: [PATCH] memcg: clean up networking headers file inclusion > > > > Memory controller doesn't need anything from the networking stack unless > > CONFIG_MEMCG_KMEM is selected. > > Now we are including net/sock.h and net/tcp_memcontrol.h unconditionally > > which is not necessary. Moreover struct mem_cgroup contains tcp_mem > > even if CONFIG_MEMCG_KMEM and CONFIG_INET are not selected which is not > > necessary. > > While we are at it, let's clean up KMEM sock code ifdefs to require both > > CONFIG_KMEM and CONFIG_INET as it doesn't make much sense to compile > > this code if there is no possible user for it. > > > > Tested with > > - CONFIG_INET && CONFIG_MEMCG_KMEM > > - !CONFIG_INET && CONFIG_MEMCG_KMEM > > - CONFIG_INET && !CONFIG_MEMCG_KMEM > > - !CONFIG_INET && !CONFIG_MEMCG_KMEM > > > > Changes since V2: > > - memcg_init_kmem and kmem_cgroup_destroy don't need CONFIG_INET > > > > Changes since V1: > > - depend on both CONFIG_INET and CONFIG_MEMCG_KMEM for both > > mem_cgroup->tcp_mem and the sock specific code > > > > Signed-off-by: Sachin Kamat > > Signed-off-by: Michal Hocko > > Seems safe now. Since the config matrix can get tricky, and we have no > pressing time issues with this, I would advise to give it a day in > Fengguang's magic system before merging it. Just put it in a temp branch > in korg and let it do the job. OK done. It is cleanups/memcg-sock-include. Fengguang, do you think we can (ab)use your build test coverity to test git://git.kernel.org/pub/scm/linux/kernel/git/mhocko/mm.git cleanups/memcg-sock-include Thanks a lot! I will repost both patches later (and hopefully I will not forget about other people on the CC list list like now...) -- Michal Hocko SUSE Labs -- 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: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx106.postini.com [74.125.245.106]) by kanga.kvack.org (Postfix) with SMTP id 9CB2E6B024F for ; Fri, 14 Sep 2012 08:41:28 -0400 (EDT) Date: Fri, 14 Sep 2012 20:41:24 +0800 From: Fengguang Wu Subject: Re: [PATCH v3] memcg: clean up networking headers file inclusion Message-ID: <20120914124124.GC21038@localhost> References: <20120914112118.GG28039@dhcp22.suse.cz> <50531339.1000805@parallels.com> <20120914113400.GI28039@dhcp22.suse.cz> <50531696.1080708@parallels.com> <20120914120849.GL28039@dhcp22.suse.cz> <5052E766.9070304@parallels.com> <20120914122413.GO28039@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120914122413.GO28039@dhcp22.suse.cz> Sender: owner-linux-mm@kvack.org List-ID: To: Michal Hocko Cc: Glauber Costa , Andrew Morton , linux-mm@kvack.org, Sachin Kamat > > Seems safe now. Since the config matrix can get tricky, and we have no > > pressing time issues with this, I would advise to give it a day in > > Fengguang's magic system before merging it. Just put it in a temp branch > > in korg and let it do the job. > > OK done. It is cleanups/memcg-sock-include. > > Fengguang, do you think we can (ab)use your build test coverity to test > git://git.kernel.org/pub/scm/linux/kernel/git/mhocko/mm.git cleanups/memcg-sock-include > > Thanks a lot! Feel free to take advantage of it to your heart's content! Actually one of my biggest joy of working (hard) is to see users being able to make utmost use of the resulted system or feature :) The tests will auto start shortly after you push the branch. Thanks, Fengguang -- 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: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx199.postini.com [74.125.245.199]) by kanga.kvack.org (Postfix) with SMTP id 481A56B0252 for ; Fri, 14 Sep 2012 08:54:10 -0400 (EDT) Date: Fri, 14 Sep 2012 14:54:07 +0200 From: Michal Hocko Subject: Re: [PATCH v3] memcg: clean up networking headers file inclusion Message-ID: <20120914125407.GP28039@dhcp22.suse.cz> References: <20120914112118.GG28039@dhcp22.suse.cz> <50531339.1000805@parallels.com> <20120914113400.GI28039@dhcp22.suse.cz> <50531696.1080708@parallels.com> <20120914120849.GL28039@dhcp22.suse.cz> <5052E766.9070304@parallels.com> <20120914122413.GO28039@dhcp22.suse.cz> <20120914124124.GC21038@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120914124124.GC21038@localhost> Sender: owner-linux-mm@kvack.org List-ID: To: Fengguang Wu Cc: Glauber Costa , Andrew Morton , linux-mm@kvack.org, Sachin Kamat On Fri 14-09-12 20:41:24, Wu Fengguang wrote: > > > Seems safe now. Since the config matrix can get tricky, and we have no > > > pressing time issues with this, I would advise to give it a day in > > > Fengguang's magic system before merging it. Just put it in a temp branch > > > in korg and let it do the job. > > > > OK done. It is cleanups/memcg-sock-include. > > > > Fengguang, do you think we can (ab)use your build test coverity to test > > git://git.kernel.org/pub/scm/linux/kernel/git/mhocko/mm.git cleanups/memcg-sock-include > > > > Thanks a lot! > > Feel free to take advantage of it to your heart's content! Actually > one of my biggest joy of working (hard) is to see users being able to > make utmost use of the resulted system or feature :) Thanks a lot and I really appraciate that! > The tests will auto start shortly after you push the branch. OK, the branch should be there so it probably need few minutes to sync. > > Thanks, > Fengguang -- Michal Hocko SUSE Labs -- 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: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx189.postini.com [74.125.245.189]) by kanga.kvack.org (Postfix) with SMTP id BFD3D6B0044 for ; Fri, 14 Sep 2012 15:45:06 -0400 (EDT) Date: Fri, 14 Sep 2012 12:45:05 -0700 From: Andrew Morton Subject: Re: [PATCH v3] memcg: clean up networking headers file inclusion Message-Id: <20120914124505.6d7756d1.akpm@linux-foundation.org> In-Reply-To: <20120914120849.GL28039@dhcp22.suse.cz> References: <20120914112118.GG28039@dhcp22.suse.cz> <50531339.1000805@parallels.com> <20120914113400.GI28039@dhcp22.suse.cz> <50531696.1080708@parallels.com> <20120914120849.GL28039@dhcp22.suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Michal Hocko Cc: Glauber Costa , linux-mm@kvack.org, Sachin Kamat On Fri, 14 Sep 2012 14:08:49 +0200 Michal Hocko wrote: > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -50,8 +50,12 @@ > #include > #include > #include "internal.h" > + > +#if defined(CONFIG_MEMCG_KMEM) && defined(CONFIG_INET) > #include > +#include > #include > +#endif That wasn't a cleanup! Why not just unconditionally include them? That will impact compile time a teeny bit, but the code is cleaner. And it's safer, too - conditionally including header files make it more likely that people will accidentally break the build by not testing all relevant CONFIG_foo combinations. -- 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: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx162.postini.com [74.125.245.162]) by kanga.kvack.org (Postfix) with SMTP id 13F656B005A for ; Mon, 17 Sep 2012 08:02:04 -0400 (EDT) Date: Mon, 17 Sep 2012 14:02:00 +0200 From: Michal Hocko Subject: [PATCH v4] memcg: cleanup kmem tcp ifdefs Message-ID: <20120917120200.GD27966@dhcp22.suse.cz> References: <20120914112118.GG28039@dhcp22.suse.cz> <50531339.1000805@parallels.com> <20120914113400.GI28039@dhcp22.suse.cz> <50531696.1080708@parallels.com> <20120914120849.GL28039@dhcp22.suse.cz> <20120914124505.6d7756d1.akpm@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120914124505.6d7756d1.akpm@linux-foundation.org> Sender: owner-linux-mm@kvack.org List-ID: To: Andrew Morton Cc: Glauber Costa , linux-mm@kvack.org, Sachin Kamat On Fri 14-09-12 12:45:05, Andrew Morton wrote: > On Fri, 14 Sep 2012 14:08:49 +0200 > Michal Hocko wrote: > > > --- a/mm/memcontrol.c > > +++ b/mm/memcontrol.c > > @@ -50,8 +50,12 @@ > > #include > > #include > > #include "internal.h" > > + > > +#if defined(CONFIG_MEMCG_KMEM) && defined(CONFIG_INET) > > #include > > +#include > > #include > > +#endif > > That wasn't a cleanup! > > Why not just unconditionally include them? That will impact compile > time a teeny bit, but the code is cleaner. > > And it's safer, too - conditionally including header files make it more > likely that people will accidentally break the build by not testing all > relevant CONFIG_foo combinations. OK, fair point. Updated patch below: ---