diff options
author | Andrew Morton <akpm@linux-foundation.org> | 2014-07-17 10:58:04 +1000 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2014-07-17 10:58:04 +1000 |
commit | 767cefe2d1bff7ce4eeaf82c8c7287b3500100e2 (patch) | |
tree | 325e35a8c94f97588a55d9279e1d94576ce45f9a /mm | |
parent | d3ac694c3e475f8f72710bacad3a41dd750ea607 (diff) |
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 <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>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/compaction.c | 17 |
1 files 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); |