X-Git-Url: http://nv-tegra.nvidia.com/gitweb/?p=linux-2.6.git;a=blobdiff_plain;f=mm%2Fmemcontrol.c;h=9793873d5a9035c5987c0e301298479e9b21a698;hp=e8493fb2d69e0cec3a09b3ad4a00d0ff83145fbc;hb=436c6541b13a73790646eb11429bdc8ee50eec41;hpb=ff7283fa3a66823933991ad55a558a3a01d5ab27 diff --git a/mm/memcontrol.c b/mm/memcontrol.c index e8493fb..9793873 100644 --- a/mm/memcontrol.c +++ b/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);