lkml.org 
[lkml]   [2021]   [Aug]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v14 061/138] mm/migrate: Add folio_migrate_flags()
Date
Matthew Wilcox (Oracle) <willy@infradead.org> wrote:

> + if (folio_test_error(folio))
> + folio_set_error(newfolio);
> + if (folio_test_referenced(folio))
> + folio_set_referenced(newfolio);
> + if (folio_test_uptodate(folio))
> + folio_mark_uptodate(newfolio);
> + if (folio_test_clear_active(folio)) {
> + VM_BUG_ON_FOLIO(folio_test_unevictable(folio), folio);
> + folio_set_active(newfolio);
> + } else if (folio_test_clear_unevictable(folio))
> + folio_set_unevictable(newfolio);
> + if (folio_test_workingset(folio))
> + folio_set_workingset(newfolio);
> + if (folio_test_checked(folio))
> + folio_set_checked(newfolio);
> + if (folio_test_mappedtodisk(folio))
> + folio_set_mappedtodisk(newfolio);

Since a bunch of these are bits in folio->flags and newfolio->flags, I wonder
if it's better to do use a cmpxchg() loop or LL/SC construct to transfer all
the relevant flags in one go.

Apart from that:

Reviewed-by: David Howells <dhowells@redhat.com>

\
 
 \ /
  Last update: 2021-08-10 23:10    [W:1.882 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site