Re: [PATCH 2/5] mm, compaction: simplify handling restart position in free pages scanner

From: Vlastimil Babka
Date: Tue Jan 20 2015 - 08:31:52 EST


On 01/20/2015 02:27 PM, Zhang Yanfei wrote:
> Hello,
>
> 在 2015/1/19 18:05, Vlastimil Babka 写道:
>> @@ -883,6 +883,8 @@ static void isolate_freepages(struct compact_control *cc)
>> nr_freepages += isolated;
>>
>> /*
>> + * If we isolated enough freepages, or aborted due to async
>> + * compaction being contended, terminate the loop.
>> * Remember where the free scanner should restart next time,
>> * which is where isolate_freepages_block() left off.
>> * But if it scanned the whole pageblock, isolate_start_pfn
>> @@ -891,28 +893,30 @@ static void isolate_freepages(struct compact_control *cc)
>> * In that case we will however want to restart at the start
>> * of the previous pageblock.
>> */
>> - cc->free_pfn = (isolate_start_pfn < block_end_pfn) ?
>> - isolate_start_pfn :
>> - block_start_pfn - pageblock_nr_pages;
>> -
>> - /*
>> - * isolate_freepages_block() might have aborted due to async
>> - * compaction being contended
>> - */
>> - if (cc->contended)
>> + if ((nr_freepages > cc->nr_migratepages) || cc->contended) {
>
> Shouldn't this be nr_freepages >= cc->nr_migratepages?

Ah, of course. Thanks for catching that!

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/