Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754028AbYCQQx0 (ORCPT ); Mon, 17 Mar 2008 12:53:26 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751646AbYCQQxT (ORCPT ); Mon, 17 Mar 2008 12:53:19 -0400 Received: from e5.ny.us.ibm.com ([32.97.182.145]:34801 "EHLO e5.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751355AbYCQQxS (ORCPT ); Mon, 17 Mar 2008 12:53:18 -0400 Subject: Re: [RFC][2/3] Account and control virtual address space allocations From: Dave Hansen To: Balbir Singh Cc: linux-mm@kvack.org, Hugh Dickins , Sudhir Kumar , YAMAMOTO Takashi , Paul Menage , lizf@cn.fujitsu.com, linux-kernel@vger.kernel.org, taka@valinux.co.jp, David Rientjes , Pavel Emelianov , Andrew Morton , KAMEZAWA Hiroyuki In-Reply-To: <20080316173005.8812.88290.sendpatchset@localhost.localdomain> References: <20080316172942.8812.56051.sendpatchset@localhost.localdomain> <20080316173005.8812.88290.sendpatchset@localhost.localdomain> Content-Type: text/plain Date: Mon, 17 Mar 2008 09:53:10 -0700 Message-Id: <1205772790.18916.17.camel@nimitz.home.sr71.net> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1206 Lines: 33 On Sun, 2008-03-16 at 23:00 +0530, Balbir Singh wrote: > @@ -787,6 +788,8 @@ static int ptrace_bts_realloc(struct tas > current->mm->total_vm -= old_size; > current->mm->locked_vm -= old_size; > > + mem_cgroup_update_as(current->mm, -old_size); > + > if (size == 0) > goto out; I think splattering these things all over is probably a bad idea. If you're going to do this, I think you need a couple of phases. 1. update the vm_(un)acct_memory() functions to take an mm 2. start using them (or some other abstracted functions in place) 3. update the new functions for cgroups It's a bit non-obvious why you do the mem_cgroup_update_as() calls in the places that you do from context. Having some other vm-abstracted functions will also keep you from splattering mem_cgroup_update_as() across the tree. That's a pretty bad name. :) ...update_mapped() or ...update_vm() might be a wee bit better. -- Dave -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/