From 73a15d649f78e7c355ba10f7725889f6d31078d4 Mon Sep 17 00:00:00 2001 From: Hugh Dickins Date: Thu, 7 Feb 2008 00:14:12 -0800 Subject: [PATCH] --- yaml --- r: 83779 b: refs/heads/master c: 436c6541b13a73790646eb11429bdc8ee50eec41 h: refs/heads/master i: 83777: 5bd210121b2d5d9595f3a73549ea1697370c7e4a 83775: 6e5029a1a9985a511649e19eab0a0656f0363489 v: v3 --- [refs] | 2 +- trunk/mm/memcontrol.c | 17 ++++------------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/[refs] b/[refs] index df3e9bd3e11d..4e8f3c1604a1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ff7283fa3a66823933991ad55a558a3a01d5ab27 +refs/heads/master: 436c6541b13a73790646eb11429bdc8ee50eec41 diff --git a/trunk/mm/memcontrol.c b/trunk/mm/memcontrol.c index e8493fb2d69e..9793873d5a90 100644 --- a/trunk/mm/memcontrol.c +++ b/trunk/mm/memcontrol.c @@ -260,24 +260,20 @@ unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, spin_lock(&mem_cont->lru_lock); scan = 0; list_for_each_entry_safe_reverse(pc, tmp, src, lru) { - if (scan++ > nr_to_scan) + if (scan >= nr_to_scan) break; page = pc->page; VM_BUG_ON(!pc); - if (unlikely(!PageLRU(page))) { - scan--; + if (unlikely(!PageLRU(page))) continue; - } if (PageActive(page) && !active) { __mem_cgroup_move_lists(pc, true); - scan--; continue; } if (!PageActive(page) && active) { __mem_cgroup_move_lists(pc, false); - scan--; continue; } @@ -288,13 +284,8 @@ unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, if (page_zone(page) != z) continue; - /* - * Check if the meta page went away from under us - */ - if (!list_empty(&pc->lru)) - list_move(&pc->lru, &pc_list); - else - continue; + scan++; + list_move(&pc->lru, &pc_list); if (__isolate_lru_page(page, mode) == 0) { list_move(&page->lru, dst);