From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx120.postini.com [74.125.245.120]) by kanga.kvack.org (Postfix) with SMTP id A8ADB6B0044 for ; Wed, 25 Apr 2012 10:45:20 -0400 (EDT) Message-ID: <4F980D90.8050109@parallels.com> Date: Wed, 25 Apr 2012 11:43:28 -0300 From: Glauber Costa MIME-Version: 1.0 Subject: Re: [PATCH 17/23] kmem controller charge/uncharge infrastructure References: <1334959051-18203-1-git-send-email-glommer@parallels.com> <1335138820-26590-6-git-send-email-glommer@parallels.com> <20120424142232.GC8626@somewhere> <4F96BB62.1030900@parallels.com> <4F971CC2.3090109@parallels.com> In-Reply-To: Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: David Rientjes Cc: Frederic Weisbecker , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, devel@openvz.org, KAMEZAWA Hiroyuki , Michal Hocko , Johannes Weiner , Greg Thelen , Suleiman Souhlal , Christoph Lameter , Pekka Enberg On 04/24/2012 07:54 PM, David Rientjes wrote: > On Tue, 24 Apr 2012, Glauber Costa wrote: > >>> Yes, for user memory, I see charging to p->mm->owner as allowing that >>> process to eventually move and be charged to a different memcg and there's >>> no way to do proper accounting if the charge is split amongst different >>> memcgs because of thread membership to a set of memcgs. This is >>> consistent with charges for shared memory being moved when a thread >>> mapping it moves to a new memcg, as well. >> >> But that's the problem. >> >> When we are dealing with kernel memory, we are allocating a whole slab page. >> It is essentially impossible to track, given a page, which task allocated >> which object. >> > > Right, so you have to make the distinction that slab charges cannot be > migrated by memory.move_charge_at_immigrate (and it's not even specified > to do anything beyond user pages in Documentation/cgroups/memory.txt), Never intended to. > but > it would be consistent to charge the same memcg for a process's slab > allocations as the process's user allocations. > > My response was why we shouldn't be charging user pages to > mem_cgroup_from_task(current) rather than > mem_cgroup_from_task(current->mm->owner) which is what is currently > implemented. Ah, all right. Well, for user memory I agree with you. My point was exactly that user memory can always be pinpointed to a specific address space, while kernel memory can't. > > If that can't be changed so that we can still migrate user memory amongst > memcgs for memory.move_charge_at_immigrate, then it seems consistent to > have all allocations done by a task to be charged to the same memcg. > Hence, I suggested current->mm->owner for slab charging as well. All right. This can be done. Although I don't see this as a must for slab as already explained, I certainly don't oppose doing so 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