diff --git a/mm/vmscan.c b/mm/vmscan.c index a85a261bf8f95df9c399ed3592e81db3040a40a3..866ab27c52a5d0ac809efe48c15205fd45e37ec4 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1196,13 +1196,17 @@ static unsigned long isolate_lru_pages(unsigned long nr_to_scan, break; if (__isolate_lru_page(cursor_page, mode, file) == 0) { + unsigned int isolated_pages; + mem_cgroup_lru_del(cursor_page); list_move(&cursor_page->lru, dst); - nr_taken += hpage_nr_pages(cursor_page); - nr_lumpy_taken++; + isolated_pages = hpage_nr_pages(cursor_page); + nr_taken += isolated_pages; + nr_lumpy_taken += isolated_pages; if (PageDirty(cursor_page)) - nr_lumpy_dirty++; + nr_lumpy_dirty += isolated_pages; scan++; + pfn += isolated_pages - 1; } else { /* * Check if the page is freed already.