From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757554Ab2IZRhl (ORCPT ); Wed, 26 Sep 2012 13:37:41 -0400 Received: from mx2.parallels.com ([64.131.90.16]:39149 "EHLO mx2.parallels.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756904Ab2IZRhg (ORCPT ); Wed, 26 Sep 2012 13:37:36 -0400 Message-ID: <50633C88.1030300@parallels.com> Date: Wed, 26 Sep 2012 21:34:00 +0400 From: Glauber Costa User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120911 Thunderbird/15.0.1 MIME-Version: 1.0 To: Michal Hocko CC: , , , , Tejun Heo , , Suleiman Souhlal , Frederic Weisbecker , Mel Gorman , David Rientjes , Johannes Weiner Subject: Re: [PATCH v3 04/13] kmem accounting basic infrastructure References: <1347977050-29476-1-git-send-email-glommer@parallels.com> <1347977050-29476-5-git-send-email-glommer@parallels.com> <20120926140347.GD15801@dhcp22.suse.cz> <50631226.9050304@parallels.com> <20120926160126.GF15801@dhcp22.suse.cz> In-Reply-To: <20120926160126.GF15801@dhcp22.suse.cz> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [109.173.3.27] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/26/2012 08:01 PM, Michal Hocko wrote: > On Wed 26-09-12 18:33:10, Glauber Costa wrote: >> On 09/26/2012 06:03 PM, Michal Hocko wrote: >>> On Tue 18-09-12 18:04:01, Glauber Costa wrote: > [...] >>>> @@ -4961,6 +5015,12 @@ mem_cgroup_create(struct cgroup *cont) >>>> int cpu; >>>> enable_swap_cgroup(); >>>> parent = NULL; >>>> + >>>> +#ifdef CONFIG_MEMCG_KMEM >>>> + WARN_ON(cgroup_add_cftypes(&mem_cgroup_subsys, >>>> + kmem_cgroup_files)); >>>> +#endif >>>> + >>>> if (mem_cgroup_soft_limit_tree_init()) >>>> goto free_out; >>>> root_mem_cgroup = memcg; >>>> @@ -4979,6 +5039,7 @@ mem_cgroup_create(struct cgroup *cont) >>>> if (parent && parent->use_hierarchy) { >>>> res_counter_init(&memcg->res, &parent->res); >>>> res_counter_init(&memcg->memsw, &parent->memsw); >>>> + res_counter_init(&memcg->kmem, &parent->kmem); >>> >>> Haven't we already discussed that a new memcg should inherit kmem_accounted >>> from its parent for use_hierarchy? >>> Say we have >>> root >>> | >>> A (kmem_accounted = 1, use_hierachy = 1) >>> \ >>> B (kmem_accounted = 0) >>> \ >>> C (kmem_accounted = 1) >>> >>> B find's itself in an awkward situation becuase it doesn't want to >>> account u+k but it ends up doing so becuase C. >>> >> >> Ok, I haven't updated it here. But that should be taken care of in the >> lifecycle patch. > > I am not sure which patch you are thinking about but I would prefer to > have it here because it is safe wrt. races and it is more obvious as > well. > The patch where I make kmem_accounted into a bitfield. So any code here will eventually disappear. But BTW, I am not saying I won't update the patch - I like that all patches work and make sense in their own, I am just saying that I forgot to update this patch, because I added the code in its final version to the end and then squashed it. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Glauber Costa Subject: Re: [PATCH v3 04/13] kmem accounting basic infrastructure Date: Wed, 26 Sep 2012 21:34:00 +0400 Message-ID: <50633C88.1030300@parallels.com> References: <1347977050-29476-1-git-send-email-glommer@parallels.com> <1347977050-29476-5-git-send-email-glommer@parallels.com> <20120926140347.GD15801@dhcp22.suse.cz> <50631226.9050304@parallels.com> <20120926160126.GF15801@dhcp22.suse.cz> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20120926160126.GF15801@dhcp22.suse.cz> Sender: owner-linux-mm@kvack.org List-ID: Content-Type: text/plain; charset="us-ascii" To: Michal Hocko Cc: linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, kamezawa.hiroyu@jp.fujitsu.com, devel@openvz.org, Tejun Heo , linux-mm@kvack.org, Suleiman Souhlal , Frederic Weisbecker , Mel Gorman , David Rientjes , Johannes Weiner On 09/26/2012 08:01 PM, Michal Hocko wrote: > On Wed 26-09-12 18:33:10, Glauber Costa wrote: >> On 09/26/2012 06:03 PM, Michal Hocko wrote: >>> On Tue 18-09-12 18:04:01, Glauber Costa wrote: > [...] >>>> @@ -4961,6 +5015,12 @@ mem_cgroup_create(struct cgroup *cont) >>>> int cpu; >>>> enable_swap_cgroup(); >>>> parent = NULL; >>>> + >>>> +#ifdef CONFIG_MEMCG_KMEM >>>> + WARN_ON(cgroup_add_cftypes(&mem_cgroup_subsys, >>>> + kmem_cgroup_files)); >>>> +#endif >>>> + >>>> if (mem_cgroup_soft_limit_tree_init()) >>>> goto free_out; >>>> root_mem_cgroup = memcg; >>>> @@ -4979,6 +5039,7 @@ mem_cgroup_create(struct cgroup *cont) >>>> if (parent && parent->use_hierarchy) { >>>> res_counter_init(&memcg->res, &parent->res); >>>> res_counter_init(&memcg->memsw, &parent->memsw); >>>> + res_counter_init(&memcg->kmem, &parent->kmem); >>> >>> Haven't we already discussed that a new memcg should inherit kmem_accounted >>> from its parent for use_hierarchy? >>> Say we have >>> root >>> | >>> A (kmem_accounted = 1, use_hierachy = 1) >>> \ >>> B (kmem_accounted = 0) >>> \ >>> C (kmem_accounted = 1) >>> >>> B find's itself in an awkward situation becuase it doesn't want to >>> account u+k but it ends up doing so becuase C. >>> >> >> Ok, I haven't updated it here. But that should be taken care of in the >> lifecycle patch. > > I am not sure which patch you are thinking about but I would prefer to > have it here because it is safe wrt. races and it is more obvious as > well. > The patch where I make kmem_accounted into a bitfield. So any code here will eventually disappear. But BTW, I am not saying I won't update the patch - I like that all patches work and make sense in their own, I am just saying that I forgot to update this patch, because I added the code in its final version to the end and then squashed 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