From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755581Ab2HOTZr (ORCPT ); Wed, 15 Aug 2012 15:25:47 -0400 Received: from mx2.parallels.com ([64.131.90.16]:33404 "EHLO mx2.parallels.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753390Ab2HOTZq (ORCPT ); Wed, 15 Aug 2012 15:25:46 -0400 Message-ID: <502BF6FA.6050602@parallels.com> Date: Wed, 15 Aug 2012 23:22:34 +0400 From: Glauber Costa User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 MIME-Version: 1.0 To: Christoph Lameter CC: Ying Han , Michal Hocko , , , , , Johannes Weiner , Andrew Morton , , David Rientjes , Pekka Enberg Subject: Re: [PATCH v2 04/11] kmem accounting basic infrastructure References: <1344517279-30646-1-git-send-email-glommer@parallels.com> <1344517279-30646-5-git-send-email-glommer@parallels.com> <20120814162144.GC6905@dhcp22.suse.cz> <502B6D03.1080804@parallels.com> <20120815123931.GF23985@dhcp22.suse.cz> <000001392ac15404-43a3fd2c-a6d3-4985-b173-74bb586ad47c-000000@email.amazonses.com> <502BBC35.809@parallels.com> <000001392aec1926-72b3a631-1fb1-460c-803d-38c4405151e1-000000@email.amazonses.com> <000001392b881bf0-4cf7cb93-c142-4ddb-960a-b35390caca0f-000000@email.amazonses.com> In-Reply-To: <000001392b881bf0-4cf7cb93-c142-4ddb-960a-b35390caca0f-000000@email.amazonses.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [109.173.1.99] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/15/2012 10:25 PM, Christoph Lameter wrote: > On Wed, 15 Aug 2012, Ying Han wrote: > >>> How can you figure out which objects belong to which memcg? The ownerships >>> of dentries and inodes is a dubious concept already. >> >> I figured it out based on the kernel slab accounting. >> obj->page->kmem_cache->memcg > > Well that is only the memcg which allocated it. It may be in use heavily > by other processes. > Yes, but a lot of the use cases for cgroups/containers are pretty local. That is why we have been able to get away with a first-touch mechanism even in user pages memcg. In those cases - which we expect to be the majority of them - this will perform well. Now, this is not of course representative of the whole range of possible use cases, and others are valid. There are people like Greg and Ying Han herself that want a more fine grained control on which memcg gets the accounting. That is one of the topics for the summit. But even then: regardless of what mechanism is in place, one cgroup is to be accounted (or not accounted at all, meaning it belongs to a non-accounted cgroup). And then we can just grab whichever memcg it was allocated from and shrink it. 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 517EE6B005D for ; Wed, 15 Aug 2012 15:25:47 -0400 (EDT) Message-ID: <502BF6FA.6050602@parallels.com> Date: Wed, 15 Aug 2012 23:22:34 +0400 From: Glauber Costa MIME-Version: 1.0 Subject: Re: [PATCH v2 04/11] kmem accounting basic infrastructure References: <1344517279-30646-1-git-send-email-glommer@parallels.com> <1344517279-30646-5-git-send-email-glommer@parallels.com> <20120814162144.GC6905@dhcp22.suse.cz> <502B6D03.1080804@parallels.com> <20120815123931.GF23985@dhcp22.suse.cz> <000001392ac15404-43a3fd2c-a6d3-4985-b173-74bb586ad47c-000000@email.amazonses.com> <502BBC35.809@parallels.com> <000001392aec1926-72b3a631-1fb1-460c-803d-38c4405151e1-000000@email.amazonses.com> <000001392b881bf0-4cf7cb93-c142-4ddb-960a-b35390caca0f-000000@email.amazonses.com> In-Reply-To: <000001392b881bf0-4cf7cb93-c142-4ddb-960a-b35390caca0f-000000@email.amazonses.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Christoph Lameter Cc: Ying Han , Michal Hocko , linux-kernel@vger.kernel.org, linux-mm@kvack.org, cgroups@vger.kernel.org, devel@openvz.org, Johannes Weiner , Andrew Morton , kamezawa.hiroyu@jp.fujitsu.com, David Rientjes , Pekka Enberg On 08/15/2012 10:25 PM, Christoph Lameter wrote: > On Wed, 15 Aug 2012, Ying Han wrote: > >>> How can you figure out which objects belong to which memcg? The ownerships >>> of dentries and inodes is a dubious concept already. >> >> I figured it out based on the kernel slab accounting. >> obj->page->kmem_cache->memcg > > Well that is only the memcg which allocated it. It may be in use heavily > by other processes. > Yes, but a lot of the use cases for cgroups/containers are pretty local. That is why we have been able to get away with a first-touch mechanism even in user pages memcg. In those cases - which we expect to be the majority of them - this will perform well. Now, this is not of course representative of the whole range of possible use cases, and others are valid. There are people like Greg and Ying Han herself that want a more fine grained control on which memcg gets the accounting. That is one of the topics for the summit. But even then: regardless of what mechanism is in place, one cgroup is to be accounted (or not accounted at all, meaning it belongs to a non-accounted cgroup). And then we can just grab whichever memcg it was allocated from and shrink 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 From: Glauber Costa Subject: Re: [PATCH v2 04/11] kmem accounting basic infrastructure Date: Wed, 15 Aug 2012 23:22:34 +0400 Message-ID: <502BF6FA.6050602@parallels.com> References: <1344517279-30646-1-git-send-email-glommer@parallels.com> <1344517279-30646-5-git-send-email-glommer@parallels.com> <20120814162144.GC6905@dhcp22.suse.cz> <502B6D03.1080804@parallels.com> <20120815123931.GF23985@dhcp22.suse.cz> <000001392ac15404-43a3fd2c-a6d3-4985-b173-74bb586ad47c-000000@email.amazonses.com> <502BBC35.809@parallels.com> <000001392aec1926-72b3a631-1fb1-460c-803d-38c4405151e1-000000@email.amazonses.com> <000001392b881bf0-4cf7cb93-c142-4ddb-960a-b35390caca0f-000000@email.amazonses.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <000001392b881bf0-4cf7cb93-c142-4ddb-960a-b35390caca0f-000000-p/GC64/jrecnJqMo6gzdpkEOCMrvLtNR@public.gmane.org> Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii" To: Christoph Lameter Cc: Ying Han , Michal Hocko , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devel-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org, Johannes Weiner , Andrew Morton , kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org, David Rientjes , Pekka Enberg On 08/15/2012 10:25 PM, Christoph Lameter wrote: > On Wed, 15 Aug 2012, Ying Han wrote: > >>> How can you figure out which objects belong to which memcg? The ownerships >>> of dentries and inodes is a dubious concept already. >> >> I figured it out based on the kernel slab accounting. >> obj->page->kmem_cache->memcg > > Well that is only the memcg which allocated it. It may be in use heavily > by other processes. > Yes, but a lot of the use cases for cgroups/containers are pretty local. That is why we have been able to get away with a first-touch mechanism even in user pages memcg. In those cases - which we expect to be the majority of them - this will perform well. Now, this is not of course representative of the whole range of possible use cases, and others are valid. There are people like Greg and Ying Han herself that want a more fine grained control on which memcg gets the accounting. That is one of the topics for the summit. But even then: regardless of what mechanism is in place, one cgroup is to be accounted (or not accounted at all, meaning it belongs to a non-accounted cgroup). And then we can just grab whichever memcg it was allocated from and shrink it.