From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx171.postini.com [74.125.245.171]) by kanga.kvack.org (Postfix) with SMTP id 017E76B00D5 for ; Wed, 12 Sep 2012 08:56:50 -0400 (EDT) Date: Wed, 12 Sep 2012 14:56:47 +0200 From: Michal Hocko Subject: Re: [PATCH] mm/memcontrol.c: Remove duplicate inclusion of sock.h file Message-ID: <20120912125647.GH21579@dhcp22.suse.cz> References: <1347350934-17712-1-git-send-email-sachin.kamat@linaro.org> <20120911095200.GB8058@dhcp22.suse.cz> <20120912072520.GB17516@dhcp22.suse.cz> <50504CE1.8030509@parallels.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <50504CE1.8030509@parallels.com> Sender: owner-linux-mm@kvack.org List-ID: To: Glauber Costa Cc: Sachin Kamat , cgroups@vger.kernel.org, linux-mm@kvack.org, Johannes Weiner , Balbir Singh , KAMEZAWA Hiroyuki , Andrew Morton On Wed 12-09-12 12:50:41, Glauber Costa wrote: [...] > >> diff --git a/mm/memcontrol.c b/mm/memcontrol.c > >> index 795e525..85ec9ff 100644 > >> --- a/mm/memcontrol.c > >> +++ b/mm/memcontrol.c > >> @@ -50,8 +50,12 @@ > >> #include > >> #include > >> #include "internal.h" > >> + > >> +#ifdef CONFIG_MEMCG_KMEM > >> #include > >> +#include > >> #include > >> +#endif > >> > >> #include > >> > >> @@ -326,7 +330,7 @@ struct mem_cgroup { > >> struct mem_cgroup_stat_cpu nocpu_base; > >> spinlock_t pcp_counter_lock; > >> > >> -#ifdef CONFIG_INET > >> +#ifdef CONFIG_MEMCG_KMEM > >> struct tcp_memcontrol tcp_mem; > >> #endif > >> }; > > If you are changing this, why not test for both? This field will be > useless with inet disabled. I usually don't like conditional in > structures (note that the "kmem" res counter in my patchsets is not > conditional to KMEM!!), but since the decision was made to make this one > conditional, I think INET is a much better test. I am fine with both though. You are right of course. Updated patch bellow: ---