/* Remapped by swiotlb-xen. */
PG_xen_remapped = PG_owner_priv_1,
- /* non-lru isolated movable page */
- PG_isolated = PG_reclaim,
-
#ifdef CONFIG_MIGRATION
+ /* movable_ops page that is isolated for migration */
+ PG_movable_ops_isolated = PG_reclaim,
/* this is a movable_ops page (for selected typed pages only) */
PG_movable_ops = PG_uptodate,
#endif
bool is_free_buddy_page(const struct page *page);
-PAGEFLAG(Isolated, isolated, PF_ANY);
-
#ifdef CONFIG_MIGRATION
/*
* This page is migratable through movable_ops (for selected typed pages
*/
TESTPAGEFLAG(MovableOps, movable_ops, PF_NO_TAIL);
SETPAGEFLAG(MovableOps, movable_ops, PF_NO_TAIL);
+/*
+ * A movable_ops page has this flag set while it is isolated for migration.
+ * This flag primarily protects against concurrent migration attempts.
+ *
+ * Once migration ended (success or failure), the flag is cleared. The
+ * flag is managed by the migration core.
+ */
+PAGEFLAG(MovableOpsIsolated, movable_ops_isolated, PF_NO_TAIL);
#else /* !CONFIG_MIGRATION */
TESTPAGEFLAG_FALSE(MovableOps, movable_ops);
SETPAGEFLAG_NOOP(MovableOps, movable_ops);
+PAGEFLAG_FALSE(MovableOpsIsolated, movable_ops_isolated);
#endif /* CONFIG_MIGRATION */
/**
if (!PageLRU(page)) {
/* Isolation code will deal with any races. */
if (unlikely(page_has_movable_ops(page)) &&
- !PageIsolated(page)) {
+ !PageMovableOpsIsolated(page)) {
if (locked) {
unlock_page_lruvec_irqrestore(locked, flags);
locked = NULL;
goto out_putfolio;
VM_WARN_ON_ONCE_PAGE(!page_has_movable_ops(page), page);
- if (PageIsolated(page))
+ if (PageMovableOpsIsolated(page))
goto out_no_isolated;
mops = page_movable_ops(page);
goto out_no_isolated;
/* Driver shouldn't use the isolated flag */
- VM_WARN_ON_ONCE_PAGE(PageIsolated(page), page);
- SetPageIsolated(page);
+ VM_WARN_ON_ONCE_PAGE(PageMovableOpsIsolated(page), page);
+ SetPageMovableOpsIsolated(page);
folio_unlock(folio);
return true;
struct folio *folio = page_folio(page);
VM_WARN_ON_ONCE_PAGE(!page_has_movable_ops(page), page);
- VM_WARN_ON_ONCE_PAGE(!PageIsolated(page), page);
+ VM_WARN_ON_ONCE_PAGE(!PageMovableOpsIsolated(page), page);
folio_lock(folio);
page_movable_ops(page)->putback_page(page);
- ClearPageIsolated(page);
+ ClearPageMovableOpsIsolated(page);
folio_unlock(folio);
folio_put(folio);
}
int rc = MIGRATEPAGE_SUCCESS;
VM_WARN_ON_ONCE_PAGE(!page_has_movable_ops(src), src);
- VM_WARN_ON_ONCE_PAGE(!PageIsolated(src), src);
+ VM_WARN_ON_ONCE_PAGE(!PageMovableOpsIsolated(src), src);
rc = page_movable_ops(src)->migrate_page(dst, src, mode);
if (rc == MIGRATEPAGE_SUCCESS)
- ClearPageIsolated(src);
+ ClearPageMovableOpsIsolated(src);
return rc;
}