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

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: KAMEZAWA Hiroyuki
Date: Wednesday, October 8, 2008 - 11:26 pm

On Thu, 9 Oct 2008 14:39:49 +0900
Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp> wrote:

It's safe just because  I added following check.

+	/*
+	 * This page_cgroup is not used but may be on LRU.
+	 */
+	if (unlikely(PageCgroupLRU(pc))) {
+		/*
+		 * pc->mem_cgroup has old information. force_empty() guarantee
+		 * that we never see stale mem_cgroup here.
+		 */
+		mz = page_cgroup_zoneinfo(pc);
+		spin_lock_irqsave(&mz->lru_lock, flags);
+		if (PageCgroupLRU(pc)) {
+			ClearPageCgroupLRU(pc);
+			__mem_cgroup_remove_list(mz, pc);
+			css_put(&pc->mem_cgroup->css);
+		}
+		spin_unlock_irqrestore(&mz->lru_lock, flags);
+	}
+	/* Here, PCG_LRU bit is cleared */

before reusing, LRU bit is unset.


ok, I'll add VM_BUG_ON().

Thanks,
-Kame

--
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)