Re: [PATCH v17 14/21] mm/compaction: do page isolation first in compaction

Alex Shi
2020-08-07T03:24:35Z

在 2020/8/7 上午2:38, Alexander Duyck 写道:
>> +
>> isolate_abort:
>> if (locked)
>> spin_unlock_irqrestore(&pgdat->lru_lock, flags);
>> + if (page) {
>> + SetPageLRU(page);
>> + put_page(page);
>> + }
>>
>> /*
>> * Updated the cached scanner pfn once the pageblock has been scanned
> We should probably be calling SetPageLRU before we release the lru
> lock instead of before. It might make sense to just call it before we
> get here, similar to how you did in the isolate_fail_put case a few
> lines later. Otherwise this seems to violate the rules you had set up
> earlier where we were only going to be setting the LRU bit while
> holding the LRU lock.

Hi Alex,

Set out of lock here should be fine. I never said we must set the bit in locking.
And this page is get by get_page_unless_zero(), no warry on release.

Thanks
Alex