lkml.org 
[lkml]   [2023]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -v2 0/9] migrate_pages(): batch TLB flushing
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()?

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