From: Andrew Morton Date: Thu, 26 Jun 2014 00:42:43 +0000 (+1000) Subject: mm/compaction.c:isolate_freepages_block(): small tuneup X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a37d1af72b151c155344d574b2d1555054627acb;p=karo-tx-linux.git 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 --- 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);