From a37d1af72b151c155344d574b2d1555054627acb Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Thu, 26 Jun 2014 10:42:43 +1000 Subject: [PATCH] mm/compaction.c:isolate_freepages_block(): small tuneup - remove unneeded `continue' - expand the scope if the `if (isloated)' test, to optimise a code path which is rarely actually taken. Cc: Bartlomiej Zolnierkiewicz Cc: Joonsoo Kim Cc: Laura Abbott Cc: Mel Gorman Cc: Michal Nazarewicz Cc: Minchan Kim Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- mm/compaction.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/mm/compaction.c b/mm/compaction.c index 21bf292b642a..51750197db11 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -325,14 +325,14 @@ static unsigned long isolate_freepages_block(struct compact_control *cc, /* Found a free page, break it into order-0 pages */ isolated = split_free_page(page); - total_isolated += isolated; - for (i = 0; i < isolated; i++) { - list_add(&page->lru, freelist); - page++; - } - - /* If a page was split, advance to the end of it */ if (isolated) { + total_isolated += isolated; + for (i = 0; i < isolated; i++) { + list_add(&page->lru, freelist); + page++; + } + + /* If a page was split, advance to the end of it */ blockpfn += isolated - 1; cursor += isolated - 1; continue; @@ -341,9 +341,6 @@ static unsigned long isolate_freepages_block(struct compact_control *cc, isolate_fail: if (strict) break; - else - continue; - } trace_mm_compaction_isolate_freepages(nr_scanned, total_isolated); -- 2.39.5