Re: [PATCH v1 1/4] mm/compaction: enable compacting >0 order folios.

Zi Yan
2023-11-20T14:06:31Z

[-- Attachment #1: Type: text/plain, Size: 1163 bytes --]

>> @@ -1144,17 +1166,18 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn,
>> goto isolate_abort;
>> }
>> }
>> + }
>> - /*
>> - * folio become large since the non-locked check,
>> - * and it's on LRU.
>> - */
>> - if (unlikely(folio_test_large(folio) && !cc->alloc_contig)) {
>> - low_pfn += folio_nr_pages(folio) - 1;
>> - nr_scanned += folio_nr_pages(folio) - 1;
>> - folio_set_lru(folio);
>> - goto isolate_fail_put;
>> - }
>> + /*
>> + * Check LRU folio order under the lock
>> + */
>> + if (unlikely(skip_isolation_on_order(folio_order(folio),
>> + cc->order) &&
>> + !cc->alloc_contig)) {
>> + low_pfn += folio_nr_pages(folio) - 1;
>> + nr_scanned += folio_nr_pages(folio) - 1;
>> + folio_set_lru(folio);
>> + goto isolate_fail_put;
>> }
>
> Why was this part moved out of the 'if (lruvec != locked)' block? If we hold the lru lock, then we do not need to check again, right?

Probably I messed this up during rebase. Thank you for pointing this out.
Will fix it in the next version.

--
Best Regards,
Yan, Zi

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 854 bytes --]