diff options
Diffstat (limited to 'mm/memcontrol.c')
-rw-r--r-- | mm/memcontrol.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index e8493fb2d69e..9793873d5a90 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -260,24 +260,20 @@ unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, | |||
260 | spin_lock(&mem_cont->lru_lock); | 260 | spin_lock(&mem_cont->lru_lock); |
261 | scan = 0; | 261 | scan = 0; |
262 | list_for_each_entry_safe_reverse(pc, tmp, src, lru) { | 262 | list_for_each_entry_safe_reverse(pc, tmp, src, lru) { |
263 | if (scan++ > nr_to_scan) | 263 | if (scan >= nr_to_scan) |
264 | break; | 264 | break; |
265 | page = pc->page; | 265 | page = pc->page; |
266 | VM_BUG_ON(!pc); | 266 | VM_BUG_ON(!pc); |
267 | 267 | ||
268 | if (unlikely(!PageLRU(page))) { | 268 | if (unlikely(!PageLRU(page))) |
269 | scan--; | ||
270 | continue; | 269 | continue; |
271 | } | ||
272 | 270 | ||
273 | if (PageActive(page) && !active) { | 271 | if (PageActive(page) && !active) { |
274 | __mem_cgroup_move_lists(pc, true); | 272 | __mem_cgroup_move_lists(pc, true); |
275 | scan--; | ||
276 | continue; | 273 | continue; |
277 | } | 274 | } |
278 | if (!PageActive(page) && active) { | 275 | if (!PageActive(page) && active) { |
279 | __mem_cgroup_move_lists(pc, false); | 276 | __mem_cgroup_move_lists(pc, false); |
280 | scan--; | ||
281 | continue; | 277 | continue; |
282 | } | 278 | } |
283 | 279 | ||
@@ -288,13 +284,8 @@ unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, | |||
288 | if (page_zone(page) != z) | 284 | if (page_zone(page) != z) |
289 | continue; | 285 | continue; |
290 | 286 | ||
291 | /* | 287 | scan++; |
292 | * Check if the meta page went away from under us | 288 | list_move(&pc->lru, &pc_list); |
293 | */ | ||
294 | if (!list_empty(&pc->lru)) | ||
295 | list_move(&pc->lru, &pc_list); | ||
296 | else | ||
297 | continue; | ||
298 | 289 | ||
299 | if (__isolate_lru_page(page, mode) == 0) { | 290 | if (__isolate_lru_page(page, mode) == 0) { |
300 | list_move(&page->lru, dst); | 291 | list_move(&page->lru, dst); |