Re: [PATCH 6/6] memcg: lazy lru addition

From: KAMEZAWA Hiroyuki
Date: Thu Oct 09 2008 - 02:51:45 EST


On Thu, 9 Oct 2008 15:21:32 +0900
Daisuke Nishimura <nishimura@xxxxxxxxxxxxxxxxx> wrote:

> On Wed, 1 Oct 2008 17:01:19 +0900, KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> wrote:
> > Delaying add_to_lru() and do it in batched manner like page_vec.
> > For doing that 2 flags PCG_USED and PCG_LRU.
> >
> > Because __set_page_cgroup_lru() itself doesn't take lock_page_cgroup(),
> > we need a sanity check inside lru_lock().
> >
> > And this delaying make css_put()/get() complicated.
> > To make it clear,
> > * css_get() is called from mem_cgroup_add_list().
> > * css_put() is called from mem_cgroup_remove_list().
> > * css_get()->css_put() is called while try_charge()->commit/cancel sequence.
> > is newly added.
> >
>
> I like this new policy, but
>
> > @@ -710,17 +774,18 @@ static void __mem_cgroup_commit_charge(s
>
> ===
> if (PageCgroupLRU(pc)) {
> ClearPageCgroupLRU(pc);
> __mem_cgroup_remove_list(mz, pc);
> css_put(&pc->mem_cgroup->css);
> }
> spin_unlock_irqrestore(&mz->lru_lock, flags);
> }
> ===
>
> Is this css_put needed yet?
>
Oh, nice catch. it's unnecessary.
I'll fix this in the next. Thank you for review.


I'll post still-under-discuss set (v7), tomorrow.
includes
- charge/commit/cancel
- move account & force_empty
- lazy lru free
- lazy lru add
Currently works well under my test..

In the next week, I'd like to restart Mem+Swap series.

Thanks,
-Kame

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/