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

From: Alex Shi
Date: Thu Aug 06 2020 - 23:25:04 EST




在 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