From mboxrd@z Thu Jan 1 00:00:00 1970 From: Glauber Costa Subject: Re: [PATCH v8 1/9] Basic kernel memory functionality for the Memory Controller Date: Fri, 9 Dec 2011 10:40:00 -0200 Message-ID: <4EE201A0.9040601@parallels.com> References: <1323120903-2831-1-git-send-email-glommer@parallels.com> <1323120903-2831-2-git-send-email-glommer@parallels.com> <20111209102113.cdb85da8.kamezawa.hiroyu@jp.fujitsu.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20111209102113.cdb85da8.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org> Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: KAMEZAWA Hiroyuki Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, lizf-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org, ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org, davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org, gthelen-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org, netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, kirill-oKw7cIdHH8eLwutG50LtGA@public.gmane.org, avagin-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org, devel-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org, eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org, mhocko-AlSwsSmVLrQ@public.gmane.org, Paul Menage On 12/08/2011 11:21 PM, KAMEZAWA Hiroyuki wrote: > On Mon, 5 Dec 2011 19:34:55 -0200 > Glauber Costa wrote: > >> This patch lays down the foundation for the kernel memory component >> of the Memory Controller. >> >> As of today, I am only laying down the following files: >> >> * memory.independent_kmem_limit >> * memory.kmem.limit_in_bytes (currently ignored) >> * memory.kmem.usage_in_bytes (always zero) >> >> Signed-off-by: Glauber Costa >> Reviewed-by: Kirill A. Shutemov >> CC: Paul Menage >> CC: Greg Thelen > > As I wrote, please CC Johannes and Michal Hocko for memcg related parts. I forgot to add them to the patch itself, but they are in the CC list of the messages. So they did get the mail. > A few questions. > == >> + val = !!val; >> + >> + if (parent&& parent->use_hierarchy&& >> + (val != parent->kmem_independent_accounting)) >> + return -EINVAL; > == > Hm, why you check val != parent->kmem_independent_accounting ? > > if (parent&& parent->use_hierarchy) > return -EINVAL; > ? Because I thought that making sure that everybody in the chain is consistent, it will make things simpler for us. But I am happy to change that if you prefer. > BTW, you didn't check this cgroup has children or not. > I think > > if (this_cgroup->use_hierarchy&& > !list_empty(this_cgroup->childlen)) > return -EINVAL; > Noted. > == >> + /* >> + * TODO: We need to handle the case in which we are doing >> + * independent kmem accounting as authorized by our parent, >> + * but then our parent changes its parameter. >> + */ >> + cgroup_lock(); >> + memcg->kmem_independent_accounting = val; >> + cgroup_unlock(); > > Do we need cgroup_lock() here ? Well, I removed almost all instances of it from previous patches, so I guess this one can go as well. -- To unsubscribe from this list: send the line "unsubscribe cgroups" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx197.postini.com [74.125.245.197]) by kanga.kvack.org (Postfix) with SMTP id 675986B004F for ; Fri, 9 Dec 2011 07:40:59 -0500 (EST) Message-ID: <4EE201A0.9040601@parallels.com> Date: Fri, 9 Dec 2011 10:40:00 -0200 From: Glauber Costa MIME-Version: 1.0 Subject: Re: [PATCH v8 1/9] Basic kernel memory functionality for the Memory Controller References: <1323120903-2831-1-git-send-email-glommer@parallels.com> <1323120903-2831-2-git-send-email-glommer@parallels.com> <20111209102113.cdb85da8.kamezawa.hiroyu@jp.fujitsu.com> In-Reply-To: <20111209102113.cdb85da8.kamezawa.hiroyu@jp.fujitsu.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: KAMEZAWA Hiroyuki Cc: linux-kernel@vger.kernel.org, lizf@cn.fujitsu.com, ebiederm@xmission.com, davem@davemloft.net, gthelen@google.com, netdev@vger.kernel.org, linux-mm@kvack.org, kirill@shutemov.name, avagin@parallels.com, devel@openvz.org, eric.dumazet@gmail.com, cgroups@vger.kernel.org, hannes@cmpxchg.org, mhocko@suse.cz, Paul Menage On 12/08/2011 11:21 PM, KAMEZAWA Hiroyuki wrote: > On Mon, 5 Dec 2011 19:34:55 -0200 > Glauber Costa wrote: > >> This patch lays down the foundation for the kernel memory component >> of the Memory Controller. >> >> As of today, I am only laying down the following files: >> >> * memory.independent_kmem_limit >> * memory.kmem.limit_in_bytes (currently ignored) >> * memory.kmem.usage_in_bytes (always zero) >> >> Signed-off-by: Glauber Costa >> Reviewed-by: Kirill A. Shutemov >> CC: Paul Menage >> CC: Greg Thelen > > As I wrote, please CC Johannes and Michal Hocko for memcg related parts. I forgot to add them to the patch itself, but they are in the CC list of the messages. So they did get the mail. > A few questions. > == >> + val = !!val; >> + >> + if (parent&& parent->use_hierarchy&& >> + (val != parent->kmem_independent_accounting)) >> + return -EINVAL; > == > Hm, why you check val != parent->kmem_independent_accounting ? > > if (parent&& parent->use_hierarchy) > return -EINVAL; > ? Because I thought that making sure that everybody in the chain is consistent, it will make things simpler for us. But I am happy to change that if you prefer. > BTW, you didn't check this cgroup has children or not. > I think > > if (this_cgroup->use_hierarchy&& > !list_empty(this_cgroup->childlen)) > return -EINVAL; > Noted. > == >> + /* >> + * TODO: We need to handle the case in which we are doing >> + * independent kmem accounting as authorized by our parent, >> + * but then our parent changes its parameter. >> + */ >> + cgroup_lock(); >> + memcg->kmem_independent_accounting = val; >> + cgroup_unlock(); > > Do we need cgroup_lock() here ? Well, I removed almost all instances of it from previous patches, so I guess this one can go as well. -- 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/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753465Ab1LIMk5 (ORCPT ); Fri, 9 Dec 2011 07:40:57 -0500 Received: from mx2.parallels.com ([64.131.90.16]:50786 "EHLO mx2.parallels.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753378Ab1LIMky (ORCPT ); Fri, 9 Dec 2011 07:40:54 -0500 Message-ID: <4EE201A0.9040601@parallels.com> Date: Fri, 9 Dec 2011 10:40:00 -0200 From: Glauber Costa User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0) Gecko/20110927 Thunderbird/7.0 MIME-Version: 1.0 To: KAMEZAWA Hiroyuki CC: , , , , , , , , , , , , , , Paul Menage Subject: Re: [PATCH v8 1/9] Basic kernel memory functionality for the Memory Controller References: <1323120903-2831-1-git-send-email-glommer@parallels.com> <1323120903-2831-2-git-send-email-glommer@parallels.com> <20111209102113.cdb85da8.kamezawa.hiroyu@jp.fujitsu.com> In-Reply-To: <20111209102113.cdb85da8.kamezawa.hiroyu@jp.fujitsu.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [201.82.130.234] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/08/2011 11:21 PM, KAMEZAWA Hiroyuki wrote: > On Mon, 5 Dec 2011 19:34:55 -0200 > Glauber Costa wrote: > >> This patch lays down the foundation for the kernel memory component >> of the Memory Controller. >> >> As of today, I am only laying down the following files: >> >> * memory.independent_kmem_limit >> * memory.kmem.limit_in_bytes (currently ignored) >> * memory.kmem.usage_in_bytes (always zero) >> >> Signed-off-by: Glauber Costa >> Reviewed-by: Kirill A. Shutemov >> CC: Paul Menage >> CC: Greg Thelen > > As I wrote, please CC Johannes and Michal Hocko for memcg related parts. I forgot to add them to the patch itself, but they are in the CC list of the messages. So they did get the mail. > A few questions. > == >> + val = !!val; >> + >> + if (parent&& parent->use_hierarchy&& >> + (val != parent->kmem_independent_accounting)) >> + return -EINVAL; > == > Hm, why you check val != parent->kmem_independent_accounting ? > > if (parent&& parent->use_hierarchy) > return -EINVAL; > ? Because I thought that making sure that everybody in the chain is consistent, it will make things simpler for us. But I am happy to change that if you prefer. > BTW, you didn't check this cgroup has children or not. > I think > > if (this_cgroup->use_hierarchy&& > !list_empty(this_cgroup->childlen)) > return -EINVAL; > Noted. > == >> + /* >> + * TODO: We need to handle the case in which we are doing >> + * independent kmem accounting as authorized by our parent, >> + * but then our parent changes its parameter. >> + */ >> + cgroup_lock(); >> + memcg->kmem_independent_accounting = val; >> + cgroup_unlock(); > > Do we need cgroup_lock() here ? Well, I removed almost all instances of it from previous patches, so I guess this one can go as well. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Glauber Costa Subject: Re: [PATCH v8 1/9] Basic kernel memory functionality for the Memory Controller Date: Fri, 9 Dec 2011 10:40:00 -0200 Message-ID: <4EE201A0.9040601@parallels.com> References: <1323120903-2831-1-git-send-email-glommer@parallels.com> <1323120903-2831-2-git-send-email-glommer@parallels.com> <20111209102113.cdb85da8.kamezawa.hiroyu@jp.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Cc: , , , , , , , , , , , , , , Paul Menage To: KAMEZAWA Hiroyuki Return-path: In-Reply-To: <20111209102113.cdb85da8.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org> Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: netdev.vger.kernel.org On 12/08/2011 11:21 PM, KAMEZAWA Hiroyuki wrote: > On Mon, 5 Dec 2011 19:34:55 -0200 > Glauber Costa wrote: > >> This patch lays down the foundation for the kernel memory component >> of the Memory Controller. >> >> As of today, I am only laying down the following files: >> >> * memory.independent_kmem_limit >> * memory.kmem.limit_in_bytes (currently ignored) >> * memory.kmem.usage_in_bytes (always zero) >> >> Signed-off-by: Glauber Costa >> Reviewed-by: Kirill A. Shutemov >> CC: Paul Menage >> CC: Greg Thelen > > As I wrote, please CC Johannes and Michal Hocko for memcg related parts. I forgot to add them to the patch itself, but they are in the CC list of the messages. So they did get the mail. > A few questions. > == >> + val = !!val; >> + >> + if (parent&& parent->use_hierarchy&& >> + (val != parent->kmem_independent_accounting)) >> + return -EINVAL; > == > Hm, why you check val != parent->kmem_independent_accounting ? > > if (parent&& parent->use_hierarchy) > return -EINVAL; > ? Because I thought that making sure that everybody in the chain is consistent, it will make things simpler for us. But I am happy to change that if you prefer. > BTW, you didn't check this cgroup has children or not. > I think > > if (this_cgroup->use_hierarchy&& > !list_empty(this_cgroup->childlen)) > return -EINVAL; > Noted. > == >> + /* >> + * TODO: We need to handle the case in which we are doing >> + * independent kmem accounting as authorized by our parent, >> + * but then our parent changes its parameter. >> + */ >> + cgroup_lock(); >> + memcg->kmem_independent_accounting = val; >> + cgroup_unlock(); > > Do we need cgroup_lock() here ? Well, I removed almost all instances of it from previous patches, so I guess this one can go as well. -- To unsubscribe from this list: send the line "unsubscribe cgroups" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html