From: Andrea Arcangeli Date: Fri, 13 Jan 2012 01:19:29 +0000 (-0800) Subject: mm: vmscan: check if we isolated a compound page during lumpy scan X-Git-Tag: upstream/snapshot3+hdmi~8349^2~40 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5013473152d1ac9d44d787fb02edda845fdf2cb3;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git mm: vmscan: check if we isolated a compound page during lumpy scan Properly take into account if we isolated a compound page during the lumpy scan in reclaim and skip over the tail pages when encountered. This corrects the values given to the tracepoint for number of lumpy pages isolated and will avoid breaking the loop early if compound pages smaller than the requested allocation size are requested. [mgorman@suse.de: Updated changelog] Signed-off-by: Andrea Arcangeli Signed-off-by: Mel Gorman Reviewed-by: Minchan Kim Reviewed-by: Rik van Riel Cc: Dave Jones Cc: Jan Kara Cc: Andy Isaacson Cc: Nai Xia Cc: Johannes Weiner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/vmscan.c b/mm/vmscan.c index a85a261..866ab27 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.