Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752762Ab0G1CjW (ORCPT ); Tue, 27 Jul 2010 22:39:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:14295 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751384Ab0G1CjV (ORCPT ); Tue, 27 Jul 2010 22:39:21 -0400 Date: Tue, 27 Jul 2010 22:39:04 -0400 From: Vivek Goyal To: KAMEZAWA Hiroyuki Cc: "linux-mm@kvack.org" , "nishimura@mxp.nes.nec.co.jp" , "balbir@linux.vnet.ibm.com" , gthelen@google.com, m-ikeda@ds.jp.nec.com, "akpm@linux-foundation.org" , "linux-kernel@vger.kernel.org" Subject: Re: [RFC][PATCH 4/7][memcg] memcg use ID in page_cgroup Message-ID: <20100728023904.GE12642@redhat.com> References: <20100727165155.8b458b7f.kamezawa.hiroyu@jp.fujitsu.com> <20100727165629.6f98145c.kamezawa.hiroyu@jp.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100727165629.6f98145c.kamezawa.hiroyu@jp.fujitsu.com> User-Agent: Mutt/1.5.20 (2009-12-10) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1954 Lines: 45 On Tue, Jul 27, 2010 at 04:56:29PM +0900, KAMEZAWA Hiroyuki wrote: > From: KAMEZAWA Hiroyuki > > Now, addresses of memory cgroup can be calculated by their ID without complex. > This patch relplaces pc->mem_cgroup from a pointer to a unsigned short. > On 64bit architecture, this offers us more 6bytes room per page_cgroup. > Use 2bytes for blkio-cgroup's page tracking. More 4bytes will be used for > some light-weight concurrent access. > > We may able to move this id onto flags field but ...go step by step. > > Signed-off-by: KAMEZAWA Hiroyuki > --- > include/linux/page_cgroup.h | 3 ++- > mm/memcontrol.c | 40 +++++++++++++++++++++++++--------------- > mm/page_cgroup.c | 2 +- > 3 files changed, 28 insertions(+), 17 deletions(-) > > Index: mmotm-0719/include/linux/page_cgroup.h > =================================================================== > --- mmotm-0719.orig/include/linux/page_cgroup.h > +++ mmotm-0719/include/linux/page_cgroup.h > @@ -12,7 +12,8 @@ > */ > struct page_cgroup { > unsigned long flags; > - struct mem_cgroup *mem_cgroup; > + unsigned short mem_cgroup; /* ID of assigned memory cgroup */ > + unsigned short blk_cgroup; /* Not Used..but will be. */ So later I shall have to use virtually indexed arrays in blkio controller? Or you are just using virtually indexed arrays for lookup speed and I can continue to use css_lookup() and not worry about using virtually indexed arrays. So the idea is that when a page is allocated, also store the blk_group id and once that page is submitted for writeback, we should be able to associate it to right blkio group? Vivek -- 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/