From mboxrd@z Thu Jan 1 00:00:00 1970 From: Frederic Weisbecker Subject: Re: [PATCH 17/23] kmem controller charge/uncharge infrastructure Date: Fri, 27 Apr 2012 13:38:45 +0200 Message-ID: <20120427113841.GB3514@somewhere.redhat.com> References: <1334959051-18203-1-git-send-email-glommer@parallels.com> <1335138820-26590-6-git-send-email-glommer@parallels.com> <20120424142232.GC8626@somewhere> Mime-Version: 1.0 Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=qB3i+099irScmzF62Gr+BdE7I33oq/g6nwcXsXLLb1c=; b=DsXoRktALais+aZGYwspTJ6pn+ENDJ5ux7EOKcyDnLof6/gE1x8ERR5gWG9ypKhRu3 6vTmTuRAteTTpk+YunDr6k2UdLAi1XSNsr/26GzuiQsvb8/v0P4NM7nNNIS+pZhYkb18 OAORRiayqlTHvAUeD/S0LOqEK/sUbVQsAYvITtFQtoXdMH74aD7mWrEkyEQ9iCDD7k3/ weGvqszYbEg2XY8OVzmrRJ1DN8XVq8441hLs1PZgukojktvPmngFWdAKwG8dz9r5pxhC Hqc0uscSe0x1mAiINDZGzEMSk632sJPojVmSCbD+ga4/20a0Mm6K9rhuvli4f0s4j5ru Cjpg== Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: David Rientjes Cc: Glauber Costa , 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 Tue, Apr 24, 2012 at 01:21:43PM -0700, David Rientjes wrote: > On Tue, 24 Apr 2012, Frederic Weisbecker wrote: > > > > This seems horribly inconsistent with memcg charging of user memory since > > > it charges to p->mm->owner and you're charging to p. So a thread attached > > > to a memcg can charge user memory to one memcg while charging slab to > > > another memcg? > > > > Charging to the thread rather than the process seem to me the right behaviour: > > you can have two threads of a same process attached to different cgroups. > > > > Perhaps it is the user memory memcg that needs to be fixed? > > > > No, because memory is represented by mm_struct, not task_struct, so you > must charge to p->mm->owner to allow for moving threads amongst memcgs > later for memory.move_charge_at_immigrate. You shouldn't be able to > charge two different memcgs for memory represented by a single mm. The idea I had was more that only the memcg of the thread that does the allocation is charged. But the problem is that this allocation can be later deallocated from another thread. So probably charging the owner is indeed the only sane way to go with user memory. -- 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