Re: [PATCH 5/6] memcg: lazy lru freeing

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Daisuke Nishimura
Date: Wednesday, October 8, 2008 - 10:39 pm

On Wed, 1 Oct 2008 17:00:05 +0900, KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote:

(snip)

I'm wondering if page_cgroup_zoneinfo is safe without lock_page_cgroup
because it dereferences pc->mem_cgroup.
I'm worring if the pc has been moved to another lru by re-charge(and re-uncharge),
and __mem_cgroup_remove_list toches a wrong(old) group.

Hmm, there are many things to be done for re-charge and re-uncharge,
so "if (!PageCgroupUsed(pc) && PageCgroupLRU(pc))" would be enough.
(it can avoid race between re-charge.)

Another user of page_cgroup_zoneinfo without lock_page_cgroup is
__mem_cgroup_move_lists called by mem_cgroup_isolate_pages,
but mem_cgroup_isolate_pages handles pc which is actually on the mz->lru
so it would be ok.
(I think adding VM_BUG_ON(mz != page_cgroup_zoneifno(pc)) would make sense,
or add new arg *mz to __mem_cgroup_move_lists?)


Thanks,
Daisuke Nishimura.
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/6] memcg update v6 (for review and discuss), KAMEZAWA Hiroyuki, (Wed Oct 1, 12:52 am)
[PATCH 1/6] atomic page_cgroup flags, KAMEZAWA Hiroyuki, (Wed Oct 1, 12:55 am)
[PATCH 2/6] memcg: allocate page_cgroup at boot, KAMEZAWA Hiroyuki, (Wed Oct 1, 12:56 am)
[PATCH 3/6] memcg: charge-commit-cancel protocl, KAMEZAWA Hiroyuki, (Wed Oct 1, 12:57 am)
[PATCH 4/6] memcg: new force_empty and move_account, KAMEZAWA Hiroyuki, (Wed Oct 1, 12:59 am)
[PATCH 5/6] memcg: lazy lru freeing, KAMEZAWA Hiroyuki, (Wed Oct 1, 1:00 am)
[PATCH 6/6] memcg: lazy lru addition, KAMEZAWA Hiroyuki, (Wed Oct 1, 1:01 am)
Re: [PATCH 3/6] memcg: charge-commit-cancel protocl, Daisuke Nishimura, (Wed Oct 1, 1:33 am)
Re: Re: [PATCH 3/6] memcg: charge-commit-cancel protocl, kamezawa.hiroyu, (Wed Oct 1, 3:04 am)
Re: [PATCH 4/6] memcg: new force_empty and move_account, KAMEZAWA Hiroyuki, (Wed Oct 1, 10:13 pm)
[PATCH 2/6] memcg: allocate page_cgroup at boot (hunk fix), KAMEZAWA Hiroyuki, (Thu Oct 2, 1:49 am)
Re: [PATCH 0/6] memcg update v6 (for review and discuss), KAMEZAWA Hiroyuki, (Thu Oct 2, 2:02 am)
Re: [PATCH 3/6] memcg: charge-commit-cancel protocl, Daisuke Nishimura, (Fri Oct 3, 3:05 am)
Re: Re: [PATCH 3/6] memcg: charge-commit-cancel protocl, kamezawa.hiroyu, (Fri Oct 3, 8:15 am)
Re: [PATCH 3/6] memcg: charge-commit-cancel protocl, Daisuke Nishimura, (Fri Oct 3, 8:25 am)
Re: [PATCH 1/6] atomic page_cgroup flags, Balbir Singh, (Mon Oct 6, 12:42 am)
Re: [PATCH 2/6] memcg: allocate page_cgroup at boot, Balbir Singh, (Mon Oct 6, 3:11 am)
Re: [PATCH 0/6] memcg update v6 (for review and discuss), KAMEZAWA Hiroyuki, (Mon Oct 6, 6:22 pm)
Re: [PATCH 5/6] memcg: lazy lru freeing, Daisuke Nishimura, (Wed Oct 8, 10:39 pm)
Re: [PATCH 6/6] memcg: lazy lru addition, Daisuke Nishimura, (Wed Oct 8, 11:21 pm)
Re: [PATCH 5/6] memcg: lazy lru freeing, KAMEZAWA Hiroyuki, (Wed Oct 8, 11:26 pm)
Re: [PATCH 6/6] memcg: lazy lru addition, KAMEZAWA Hiroyuki, (Wed Oct 8, 11:51 pm)