Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm: rename PG_isolated to PG_movable_ops_isolated

Let's rename the flag to make it clearer where it applies (not folios
...).

While at it, define the flag only with CONFIG_MIGRATION.

Link: https://lkml.kernel.org/r/20250704102524.326966-22-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Zi Yan <ziy@nvidia.com>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Reviewed-by: Harry Yoo <harry.yoo@oracle.com>
Cc: Alistair Popple <apopple@nvidia.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Brendan Jackman <jackmanb@google.com>
Cc: Byungchul Park <byungchul@sk.com>
Cc: Chengming Zhou <chengming.zhou@linux.dev>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Eugenio Pé rez <eperezma@redhat.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Gregory Price <gourry@gourry.net>
Cc: "Huang, Ying" <ying.huang@linux.alibaba.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Jason Wang <jasowang@redhat.com>
Cc: Jerrin Shaji George <jerrin.shaji-george@broadcom.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Joshua Hahn <joshua.hahnjy@gmail.com>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Mathew Brost <matthew.brost@intel.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Miaohe Lin <linmiaohe@huawei.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Naoya Horiguchi <nao.horiguchi@gmail.com>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Peter Xu <peterx@redhat.com>
Cc: Qi Zheng <zhengqi.arch@bytedance.com>
Cc: Rakie Kim <rakie.kim@sk.com>
Cc: Rik van Riel <riel@surriel.com>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Cc: xu xin <xu.xin16@zte.com.cn>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

David Hildenbrand and committed by
Andrew Morton
92f09176 3d388584

+19 -13
+11 -5
include/linux/page-flags.h
··· 167 167 /* Remapped by swiotlb-xen. */ 168 168 PG_xen_remapped = PG_owner_priv_1, 169 169 170 - /* non-lru isolated movable page */ 171 - PG_isolated = PG_reclaim, 172 - 173 170 #ifdef CONFIG_MIGRATION 171 + /* movable_ops page that is isolated for migration */ 172 + PG_movable_ops_isolated = PG_reclaim, 174 173 /* this is a movable_ops page (for selected typed pages only) */ 175 174 PG_movable_ops = PG_uptodate, 176 175 #endif ··· 1125 1126 1126 1127 bool is_free_buddy_page(const struct page *page); 1127 1128 1128 - PAGEFLAG(Isolated, isolated, PF_ANY); 1129 - 1130 1129 #ifdef CONFIG_MIGRATION 1131 1130 /* 1132 1131 * This page is migratable through movable_ops (for selected typed pages ··· 1144 1147 */ 1145 1148 TESTPAGEFLAG(MovableOps, movable_ops, PF_NO_TAIL); 1146 1149 SETPAGEFLAG(MovableOps, movable_ops, PF_NO_TAIL); 1150 + /* 1151 + * A movable_ops page has this flag set while it is isolated for migration. 1152 + * This flag primarily protects against concurrent migration attempts. 1153 + * 1154 + * Once migration ended (success or failure), the flag is cleared. The 1155 + * flag is managed by the migration core. 1156 + */ 1157 + PAGEFLAG(MovableOpsIsolated, movable_ops_isolated, PF_NO_TAIL); 1147 1158 #else /* !CONFIG_MIGRATION */ 1148 1159 TESTPAGEFLAG_FALSE(MovableOps, movable_ops); 1149 1160 SETPAGEFLAG_NOOP(MovableOps, movable_ops); 1161 + PAGEFLAG_FALSE(MovableOpsIsolated, movable_ops_isolated); 1150 1162 #endif /* CONFIG_MIGRATION */ 1151 1163 1152 1164 /**
+1 -1
mm/compaction.c
··· 1051 1051 if (!PageLRU(page)) { 1052 1052 /* Isolation code will deal with any races. */ 1053 1053 if (unlikely(page_has_movable_ops(page)) && 1054 - !PageIsolated(page)) { 1054 + !PageMovableOpsIsolated(page)) { 1055 1055 if (locked) { 1056 1056 unlock_page_lruvec_irqrestore(locked, flags); 1057 1057 locked = NULL;
+7 -7
mm/migrate.c
··· 135 135 goto out_putfolio; 136 136 137 137 VM_WARN_ON_ONCE_PAGE(!page_has_movable_ops(page), page); 138 - if (PageIsolated(page)) 138 + if (PageMovableOpsIsolated(page)) 139 139 goto out_no_isolated; 140 140 141 141 mops = page_movable_ops(page); ··· 146 146 goto out_no_isolated; 147 147 148 148 /* Driver shouldn't use the isolated flag */ 149 - VM_WARN_ON_ONCE_PAGE(PageIsolated(page), page); 150 - SetPageIsolated(page); 149 + VM_WARN_ON_ONCE_PAGE(PageMovableOpsIsolated(page), page); 150 + SetPageMovableOpsIsolated(page); 151 151 folio_unlock(folio); 152 152 153 153 return true; ··· 177 177 struct folio *folio = page_folio(page); 178 178 179 179 VM_WARN_ON_ONCE_PAGE(!page_has_movable_ops(page), page); 180 - VM_WARN_ON_ONCE_PAGE(!PageIsolated(page), page); 180 + VM_WARN_ON_ONCE_PAGE(!PageMovableOpsIsolated(page), page); 181 181 folio_lock(folio); 182 182 page_movable_ops(page)->putback_page(page); 183 - ClearPageIsolated(page); 183 + ClearPageMovableOpsIsolated(page); 184 184 folio_unlock(folio); 185 185 folio_put(folio); 186 186 } ··· 218 218 int rc = MIGRATEPAGE_SUCCESS; 219 219 220 220 VM_WARN_ON_ONCE_PAGE(!page_has_movable_ops(src), src); 221 - VM_WARN_ON_ONCE_PAGE(!PageIsolated(src), src); 221 + VM_WARN_ON_ONCE_PAGE(!PageMovableOpsIsolated(src), src); 222 222 rc = page_movable_ops(src)->migrate_page(dst, src, mode); 223 223 if (rc == MIGRATEPAGE_SUCCESS) 224 - ClearPageIsolated(src); 224 + ClearPageMovableOpsIsolated(src); 225 225 return rc; 226 226 } 227 227