From: Andrew Morton Date: Thu, 22 May 2014 00:42:44 +0000 (+1000) Subject: mm/compaction.c:isolate_freepages_block(): small tuneup X-Git-Tag: next-20140530~2^2~380 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=d19c07769a0242ce1aef06f40059f95d251cb0d4;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 actualyl 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 627dc2e4320f..73a2daefba47 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -293,14 +293,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; @@ -309,9 +309,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);