lkml.org 
[lkml]   [2023]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH -v2 0/9] migrate_pages(): batch TLB flushing
Date
Matthew Wilcox <willy@infradead.org> writes:

> On Fri, Jan 13, 2023 at 10:42:08AM +0800, Huang, Ying wrote:
>> +++ b/mm/migrate.c
>> @@ -1187,10 +1187,13 @@ static int __migrate_folio_move(struct folio *src, struct folio *dst,
>> int rc;
>> int page_was_mapped = 0;
>> struct anon_vma *anon_vma = NULL;
>> + bool is_lru = !__PageMovable(&src->page);
>>
>> __migrate_folio_extract(dst, &page_was_mapped, &anon_vma);
>>
>> rc = move_to_new_folio(dst, src, mode);
>> + if (!unlikely(is_lru))
>> + goto out_unlock_both;
>
> This reads a little awkwardly. Could it be:
>
> if (likely(!is_lru))
>
> ... but honestly, I think the polarity here is wrong. LRU pages tend to
> outnumber !LRU pages, so shouldn't this be:
>
> if (unlikely(!is_lru)) {
>
> just like it is in migrate_folio_unmap()?

Yes. Thank you very much for pointing this out. Will fix it for the
next version.

Best Regards,
Huang, Ying

\
 
 \ /
  Last update: 2023-03-26 23:42    [W:0.049 / U:0.464 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site