]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm/compaction.c:isolate_freepages_block(): small tuneup
authorAndrew Morton <akpm@linux-foundation.org>
Thu, 26 Jun 2014 00:42:43 +0000 (10:42 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 26 Jun 2014 00:42:43 +0000 (10:42 +1000)
- remove unneeded `continue'

- expand the scope if the `if (isloated)' test, to optimise a code path
  which is rarely actually taken.

Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Laura Abbott <lauraa@codeaurora.org>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Michal Nazarewicz <mina86@mina86.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/compaction.c

index 21bf292b642a6c67fcf953a631ba0bb4534a0215..51750197db11d2b94793349c6e1204dd8bc6e65c 100644 (file)
@@ -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);