lkml.org 
[lkml]   [2010]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC][PATCH 4/7][memcg] memcg use ID in page_cgroup
    On Tue, Jul 27, 2010 at 04:56:29PM +0900, KAMEZAWA Hiroyuki wrote:
    > From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
    >
    > 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 <kamezawa.hiroyu@jp.fujitsu.com>
    > ---
    > 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


    \
     
     \ /
      Last update: 2010-07-28 04:41    [W:0.075 / U:95.148 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site