lkml.org 
[lkml]   [2008]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC][PATCH 1/2] memcg: res_counter hierarchy
    On Wed, 4 Jun 2008 01:59:31 -0700
    "Paul Menage" <menage@google.com> wrote:

    > On Tue, Jun 3, 2008 at 10:01 PM, KAMEZAWA Hiroyuki
    > <kamezawa.hiroyu@jp.fujitsu.com> wrote:
    > > int ret;
    > > char *buf, *end;
    > > @@ -133,13 +145,101 @@ ssize_t res_counter_write(struct res_cou
    > > if (*end != '\0')
    > > goto out_free;
    > > }
    > > - spin_lock_irqsave(&counter->lock, flags);
    > > - val = res_counter_member(counter, member);
    > > - *val = tmp;
    > > - spin_unlock_irqrestore(&counter->lock, flags);
    > > - ret = nbytes;
    > > + if (set_strategy) {
    > > + ret = set_strategy(res, tmp, member);
    > > + if (!ret)
    > > + ret = nbytes;
    > > + } else {
    > > + spin_lock_irqsave(&counter->lock, flags);
    > > + val = res_counter_member(counter, member);
    > > + *val = tmp;
    > > + spin_unlock_irqrestore(&counter->lock, flags);
    > > + ret = nbytes;
    > > + }
    >
    > I think that the hierarchy/reclaim handling that you currently have in
    > the memory controller should be here; the memory controller should
    > just be able to pass a reference to try_to_free_mem_cgroup_pages() and
    > have everything else handled by res_counter.
    >
    Sounds reasonable. I'll re-design the whole AMAP. I think I can do more.

    Thanks,
    -Kame



    \
     
     \ /
      Last update: 2008-06-04 11:15    [W:0.025 / U:0.420 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site