On 04.07.25 12:25, David Hildenbrand wrote:
Instead, let's use a page flag. As the page flag can result in
false-positives, glue it to the page types for which we
support/implement movable_ops page migration.
We are reusing PG_uptodate, that is for example used to track file
system stat
have to introduce __SETPAGEFLAG_NOOP().
Reviewed-by: Zi Yan
Reviewed-by: Lorenzo Stoakes
Signed-off-by: David Hildenbrand
---
include/linux/balloon_compaction.h | 2 +-
include/linux/migrate.h| 8 -
include/linux/page-flags.h | 54 -
Let's just special-case based on IS_ENABLED(CONFIG_BALLOON_COMPACTION)
like we did for balloon_page_finalize().
Reviewed-by: Lorenzo Stoakes
Signed-off-by: David Hildenbrand
---
include/linux/balloon_compaction.h | 42 +++---
1 file changed, 15 insertions(+
Let's bring the docs up-to-date. Setting PG_movable_ops + page->private
very likely still requires to be performed under documented locks:
it's complicated.
We will rework this in the future, as we will try avoiding using the
page lock.
Reviewed-by: Lorenzo Stoakes
Signed-
Now that the mapping flags are only used for folios, let's rename the
defines.
Reviewed-by: Zi Yan
Reviewed-by: Lorenzo Stoakes
Reviewed-by: Harry Yoo
Signed-off-by: David Hildenbrand
---
fs/proc/page.c | 4 ++--
include/linux/fs.h | 2 +-
include/linux/mm_ty
Let's bring the docs up-to-date.
Reviewed-by: Zi Yan
Reviewed-by: Lorenzo Stoakes
Reviewed-by: Harry Yoo
Signed-off-by: David Hildenbrand
---
Documentation/mm/page_migration.rst | 39 -
1 file changed, 27 insertions(+), 12 deletions(-)
diff --git a/Document
ed-by: Lorenzo Stoakes
Reviewed-by: Harry Yoo
Signed-off-by: David Hildenbrand
---
include/linux/mm.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/mm.h b/include/linux/mm.h
index ef40f68c1183d..805108d7bbc31 100644
--- a/include/linux/mm.h
+++ b/include/
It's unused and the page counterpart is gone, so let's remove it.
Reviewed-by: Zi Yan
Reviewed-by: Lorenzo Stoakes
Reviewed-by: Harry Yoo
Signed-off-by: David Hildenbrand
---
include/linux/page-flags.h | 5 -
1 file changed, 5 deletions(-)
diff --git a/include/linux/page
off-by: David Hildenbrand
---
include/linux/page-flags.h | 5 -
mm/page_alloc.c| 7 +++
2 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 094c8605a879e..fc159fa945351 100644
--- a/include/linux/page-flag
KSM is the only remaining user, let's rename the flag. While at it,
adjust to remaining page -> folio in the doc.
Reviewed-by: Zi Yan
Reviewed-by: Lorenzo Stoakes
Reviewed-by: Harry Yoo
Signed-off-by: David Hildenbrand
---
include/linux/page-flags.h | 12 ++--
1 file ch
Let's rename the flag to make it clearer where it applies (not folios
...).
While at it, define the flag only with CONFIG_MIGRATION.
Reviewed-by: Zi Yan
Reviewed-by: Lorenzo Stoakes
Reviewed-by: Harry Yoo
Signed-off-by: David Hildenbrand
---
include/linux/page-flags.h
ing movable (having movable_ops), which we will change next.
Reviewed-by: Zi Yan
Reviewed-by: Lorenzo Stoakes
Reviewed-by: Harry Yoo
Signed-off-by: David Hildenbrand
---
include/linux/balloon_compaction.h | 2 +-
include/linux/migrate.h| 14 ++
include/linux/zsmallo
ework page_has_movable_ops() soon either way to no longer
rely on page->mapping.
Wherever we cast from folio to page now is a clear sign that this
code has to be decoupled.
Reviewed-by: Zi Yan
Reviewed-by: Lorenzo Stoakes
Reviewed-by: Harry Yoo
Signed-off-by: David Hildenbrand
---
include/li
PageMovable() checks by __PageMovable(). In fact,
__PageMovable() cannot change until a page is freed, so we can turn
some PageMovable() into sanity checks for __PageMovable().
Reviewed-by: Zi Yan
Reviewed-by: Lorenzo Stoakes
Reviewed-by: Harry Yoo
Signed-off-by: David Hildenbrand
---
include/linux
Currently, we only support migration of individual movable_ops pages, so
we can not run into that.
Reviewed-by: Zi Yan
Reviewed-by: Lorenzo Stoakes
Reviewed-by: Harry Yoo
Signed-off-by: David Hildenbrand
---
mm/page_isolation.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff
Let's make it clearer that we are talking about movable_ops pages.
While at it, convert a VM_BUG_ON to a VM_WARN_ON_ONCE_PAGE.
Reviewed-by: Zi Yan
Reviewed-by: Lorenzo Stoakes
Reviewed-by: Harry Yoo
Signed-off-by: David Hildenbrand
---
include/linux/migrate.h| 2 +-
include/linux
renzo Stoakes
Signed-off-by: David Hildenbrand
---
include/linux/migrate.h | 8 ++--
mm/compaction.c | 11 ---
2 files changed, 2 insertions(+), 17 deletions(-)
diff --git a/include/linux/migrate.h b/include/linux/migrate.h
index c99a00d4ca27d..6eeda8eb1e0d8 100644
--- a/include/
ack. Add a WARN_ON_ONCE for now.
Reviewed-by: Lorenzo Stoakes
Signed-off-by: David Hildenbrand
---
include/linux/balloon_compaction.h | 4 +---
mm/balloon_compaction.c| 11 +++
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/include/linux/balloon_compact
TODO for that.
Reviewed-by: Harry Yoo
Reviewed-by: Lorenzo Stoakes
Signed-off-by: David Hildenbrand
---
mm/zsmalloc.c | 18 ++
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index 626f09fb27138..b12250e219bb7 100644
--- a/mm/zsmall
pages)
Reviewed-by: Zi Yan
Reviewed-by: Harry Yoo
Reviewed-by: Lorenzo Stoakes
Signed-off-by: David Hildenbrand
---
mm/migrate.c | 63 +---
1 file changed, 30 insertions(+), 33 deletions(-)
diff --git a/mm/migrate.c b/mm/migrate.c
index d66d0776
igned-off-by: David Hildenbrand
---
include/linux/migrate.h | 14 --
1 file changed, 14 deletions(-)
diff --git a/include/linux/migrate.h b/include/linux/migrate.h
index c0ec7422837bd..c99a00d4ca27d 100644
--- a/include/linux/migrate.h
+++ b/include/linux/migrate.h
@@ -118,20 +
st_anon()
to make it clearer, because movable_ops pages will never take that path.
Reviewed-by: Zi Yan
Reviewed-by: Lorenzo Stoakes
Signed-off-by: David Hildenbrand
---
mm/migrate.c | 82
1 file changed, 45 insertions(+), 37 deletions(-)
diff --git
... and factor the complete handling of movable_ops pages out.
Convert it similar to isolate_movable_ops_page().
While at it, convert the VM_BUG_ON_FOLIO() into a VM_WARN_ON_PAGE().
Reviewed-by: Lorenzo Stoakes
Reviewed-by: Harry Yoo
Reviewed-by: Zi Yan
Signed-off-by: David Hildenbrand
Yoo
Reviewed-by: Lorenzo Stoakes
Signed-off-by: David Hildenbrand
---
include/linux/migrate.h | 4 ++--
mm/compaction.c | 2 +-
mm/migrate.c| 39 +--
3 files changed, 32 insertions(+), 13 deletions(-)
diff --git a/include/linux/migrate.h b/incl
: David Hildenbrand
---
mm/zpdesc.h | 5 -
mm/zsmalloc.c | 4 ++--
2 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/mm/zpdesc.h b/mm/zpdesc.h
index 5cb7e3de43952..5763f36039736 100644
--- a/mm/zpdesc.h
+++ b/mm/zpdesc.h
@@ -163,11 +163,6 @@ static inline void __zpdesc_set_zsmalloc
Let the page freeing code handle clearing the page type. Being able to
identify balloon pages until actually freed is a requirement for
upcoming movable_ops migration changes.
Acked-by: Zi Yan
Acked-by: Harry Yoo
Reviewed-by: Lorenzo Stoakes
Signed-off-by: David Hildenbrand
---
include/linux
ransition phase).
In the future we might want to warn on some page types. Instead of
having an "allow list", let's rather wait until we know about once that
should go on such a "disallow list".
Reviewed-by: Zi Yan
Acked-by: Harry Yoo
Reviewed-by: Lorenzo Stoakes
S
Let's drop these checks; these are conditions the core migration code
must make sure will hold either way, no need to double check.
Acked-by: Zi Yan
Reviewed-by: Sergey Senozhatsky
Acked-by: Harry Yoo
Reviewed-by: Lorenzo Stoakes
Signed-off-by: David Hildenbrand
---
mm/zpdesc.h
ust before dropping
the balloon reference.
Document that the page lock is currently required when modifying the
movability aspects of a page; hopefully we can soon decouple this from the
page lock.
Reviewed-by: Lorenzo Stoakes
Signed-off-by: David Hildenbrand
---
arch/powerpc/platforms/pseries/
Signed-off-by: David Hildenbrand
---
mm/balloon_compaction.c | 6 --
1 file changed, 6 deletions(-)
diff --git a/mm/balloon_compaction.c b/mm/balloon_compaction.c
index d3e00731e2628..fcb60233aa35d 100644
--- a/mm/balloon_compaction.c
+++ b/mm/balloon_compaction.c
@@ -94,12 +94,6 @
e: move movable_ops page handling out of move_to_new_folio()"
-> Fix goto out; vs goto out_unlock_both;
* "mm: remove __folio_test_movable()"
-> Fix page_has_movable_ops() checking wrong page
Cc: Andrew Morton
Cc: Jonathan Corbet
Cc: Madhavan Srinivasan
Cc: Michael Ellerman
On 03.07.25 05:22, Sergey Senozhatsky wrote:
On (25/07/03 11:28), Sergey Senozhatsky wrote:
static int zs_page_migrate(struct page *newpage, struct page *page,
@@ -1736,6 +1736,13 @@ static int zs_page_migrate(struct page *newpage, struct
page *page,
unsigned long old_obj, new_obj;
On 02.07.25 15:01, Harry Yoo wrote:
On Wed, Jul 02, 2025 at 02:01:33PM +0200, David Hildenbrand wrote:
On 02.07.25 13:54, Harry Yoo wrote:
On Mon, Jun 30, 2025 at 03:00:01PM +0200, David Hildenbrand wrote:
Instead, let's use a page flag. As the page flag can result in
false-positives, gl
On 02.07.25 16:23, Harry Yoo wrote:
On Mon, Jun 30, 2025 at 03:00:08PM +0200, David Hildenbrand wrote:
Let's bring the docs up-to-date.
Reviewed-by: Zi Yan
Signed-off-by: David Hildenbrand
---
+movable_ops page migration
+==
+
+Selected typed, non-folio pages
On 02.07.25 13:54, Harry Yoo wrote:
On Mon, Jun 30, 2025 at 03:00:01PM +0200, David Hildenbrand wrote:
Instead, let's use a page flag. As the page flag can result in
false-positives, glue it to the page types for which we
support/implement movable_ops page migration.
The flag reus
On 02.07.25 13:43, Harry Yoo wrote:
On Wed, Jul 02, 2025 at 01:04:05PM +0200, David Hildenbrand wrote:
On 02.07.25 12:34, Harry Yoo wrote:
On Mon, Jun 30, 2025 at 03:00:00PM +0200, David Hildenbrand wrote:
... instead, look them up statically based on the page type. Maybe in the
future we
On 02.07.25 12:34, Harry Yoo wrote:
On Mon, Jun 30, 2025 at 03:00:00PM +0200, David Hildenbrand wrote:
... instead, look them up statically based on the page type. Maybe in the
future we want a registration interface? At least for now, it can be
easily handled using the two page types that
On 02.07.25 12:10, Sergey Senozhatsky wrote:
On (25/07/02 10:25), David Hildenbrand wrote:
On 02.07.25 10:11, Sergey Senozhatsky wrote:
On (25/06/30 14:59), David Hildenbrand wrote:
[..]
static int zs_page_migrate(struct page *newpage, struct page *page,
@@ -1736,6 +1736,13 @@ static int
On 02.07.25 11:09, Lorenzo Stoakes wrote:
On Wed, Jul 02, 2025 at 11:02:21AM +0200, David Hildenbrand wrote:
On 02.07.25 10:49, Lorenzo Stoakes wrote:
On Tue, Jul 01, 2025 at 09:34:41PM +0200, David Hildenbrand wrote:
On 01.07.25 15:02, Lorenzo Stoakes wrote:
On Mon, Jun 30, 2025 at 03:00
On 02.07.25 10:49, Lorenzo Stoakes wrote:
On Tue, Jul 01, 2025 at 09:34:41PM +0200, David Hildenbrand wrote:
On 01.07.25 15:02, Lorenzo Stoakes wrote:
On Mon, Jun 30, 2025 at 03:00:04PM +0200, David Hildenbrand wrote:
We can now simply check for PageAnon() and remove PageMappingFlags
On 02.07.25 10:11, Sergey Senozhatsky wrote:
On (25/06/30 14:59), David Hildenbrand wrote:
[..]
static int zs_page_migrate(struct page *newpage, struct page *page,
@@ -1736,6 +1736,13 @@ static int zs_page_migrate(struct page *newpage, struct
page *page,
unsigned long old_obj
On 30.06.25 14:59, David Hildenbrand wrote:
Based on mm/mm-new.
In the future, as we decouple "struct page" from "struct folio", pages
that support "non-lru page migration" -- movable_ops page migration
such as memory balloons and zsmalloc -- will no longer
On 01.07.25 15:02, Lorenzo Stoakes wrote:
On Mon, Jun 30, 2025 at 03:00:04PM +0200, David Hildenbrand wrote:
We can now simply check for PageAnon() and remove PageMappingFlags().
... and while at it, use the folio instead and operate on
folio->mapping.
Probably worth mentioning to be su
On 01.07.25 14:54, Lorenzo Stoakes wrote:
On Mon, Jun 30, 2025 at 03:00:03PM +0200, David Hildenbrand wrote:
KSM is the only remaining user, let's rename the flag. While at it,
adjust to remaining page -> folio in the doc.
Hm I wonder if we could just ideally have this be a separ
PAGEFLAG(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 manag
On 01.07.25 13:03, Lorenzo Stoakes wrote:
On Mon, Jun 30, 2025 at 02:59:58PM +0200, David Hildenbrand wrote:
Currently, we only support migration of individual movable_ops pages, so
we can not run into that.
Reviewed-by: Zi Yan
Signed-off-by: David Hildenbrand
Seems sensible, so:
Reviewed
On 01.07.25 14:44, Lorenzo Stoakes wrote:
On Mon, Jun 30, 2025 at 03:00:01PM +0200, David Hildenbrand wrote:
Instead, let's use a page flag. As the page flag can result in
false-positives, glue it to the page types for which we
support/implement movable_ops page migration.
The flag reus
On 01.07.25 14:12, Lorenzo Stoakes wrote:
On Mon, Jun 30, 2025 at 03:00:00PM +0200, David Hildenbrand wrote:
... instead, look them up statically based on the page type. Maybe in the
future we want a registration interface? At least for now, it can be
easily handled using the two page types
---
include/linux/page-flags.h | 6 --
mm/migrate.c | 43 --
mm/vmscan.c| 6 --
3 files changed, 17 insertions(+), 38 deletions(-)
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index c67163b73c
OK I guess this is fine... :)
An aside, unrelated tot his series: it'd be nice to use 'deflate' consistently
in this code. We do __count_vm_event(BALLOON_DEFLATE) in
balloon_page_list_dequeue() but say 'deflate' nowhere else... well before this
patch :)
Right, dequeue is actually deflate, becau
On 01.07.25 12:59, Lorenzo Stoakes wrote:
On Mon, Jun 30, 2025 at 02:59:57PM +0200, David Hildenbrand wrote:
Let's make it clearer that we are talking about movable_ops pages.
While at it, convert a VM_BUG_ON to a VM_WARN_ON_ONCE_PAGE.
<3
Reviewed-by: Zi Yan
Signed-off-b
On 01.07.25 12:50, Lorenzo Stoakes wrote:
On Mon, Jun 30, 2025 at 02:59:56PM +0200, David Hildenbrand wrote:
As __ClearPageMovable() is gone that would have only made
PageMovable()==false but still __PageMovable()==true, now
PageMovable() == __PageMovable().
I think this could be rephrased to
On 01.07.25 12:43, Lorenzo Stoakes wrote:
On Mon, Jun 30, 2025 at 02:59:55PM +0200, David Hildenbrand wrote:
Unused, let's remove it.
The Chinese docs in Documentation/translations/zh_CN/mm/page_migration.rst
still mention it, but that whole docs is destined to get outdated and
updat
On 01.07.25 10:27, Lorenzo Stoakes wrote:
On Tue, Jul 01, 2025 at 10:17:13AM +0200, David Hildenbrand wrote:
On 30.06.25 17:27, Lorenzo Stoakes wrote:
On Mon, Jun 30, 2025 at 02:59:45PM +0200, David Hildenbrand wrote:
Currently, any user of page types must clear that type before freeing
a
On 01.07.25 12:03, Lorenzo Stoakes wrote:
On Mon, Jun 30, 2025 at 02:59:54PM +0200, David Hildenbrand wrote:
We can just look at the balloon device (stored in page->private), to see
if the page is still part of the balloon.
As isolated balloon pages cannot get released (they are taken off
On 30.06.25 19:07, Lorenzo Stoakes wrote:
On Mon, Jun 30, 2025 at 02:59:51PM +0200, David Hildenbrand wrote:
Folios will have nothing to do with movable_ops page migration. These
functions are now unused, so let's remove them.
Maybe worth mentioning that __folio_test_movable() is st
On 01.07.25 11:24, David Hildenbrand wrote:
On 30.06.25 19:05, Lorenzo Stoakes wrote:
On Mon, Jun 30, 2025 at 02:59:50PM +0200, David Hildenbrand wrote:
Let's factor it out, simplifying the calling code.
The assumption is that flush_dcache_page() is not required for
movable_ops page
On 01.07.25 10:37, Lorenzo Stoakes wrote:
On Tue, Jul 01, 2025 at 10:34:33AM +0200, David Hildenbrand wrote:
Reviewed-by: Zi Yan
Acked-by: Harry Yoo
Signed-off-by: David Hildenbrand
Based on discussion below, I'm good with this now with the comment change, so
feel free to add:
Review
[...]
-{
- __ClearPageOffline(page);
- __ClearPageMovable(page);
- set_page_private(page, 0);
- /*
-* No touch page.lru field once @page has been isolated
-* because VM is using the field.
-*/
- if (!PageIsolated(page))
- list_d
On 30.06.25 19:05, Lorenzo Stoakes wrote:
On Mon, Jun 30, 2025 at 02:59:50PM +0200, David Hildenbrand wrote:
Let's factor it out, simplifying the calling code.
The assumption is that flush_dcache_page() is not required for
movable_ops pages: as documented for flush_dcache_folio(), it r
On 30.06.25 18:24, Lorenzo Stoakes wrote:
On Mon, Jun 30, 2025 at 02:59:48PM +0200, David Hildenbrand wrote:
... and start moving back to per-page things that will absolutely not be
folio things in the future. Add documentation and a comment that the
remaining folio stuff (lock, refcount) will
On 30.06.25 18:03, Lorenzo Stoakes wrote:
On Mon, Jun 30, 2025 at 02:59:47PM +0200, David Hildenbrand wrote:
Let the page freeing code handle clearing the page type.
Acked-by: Zi Yan
Reviewed-by: Sergey Senozhatsky
Acked-by: Harry Yoo
Signed-off-by: David Hildenbrand
On basis of sanity
On 30.06.25 18:01, Lorenzo Stoakes wrote:
On Mon, Jun 30, 2025 at 02:59:46PM +0200, David Hildenbrand wrote:
Let the page freeing code handle clearing the page type.
Why is this advantageous? We want to keep the page marked offline for longer?
Less code? ;)
I will add:
"Being ab
On 30.06.25 17:27, Lorenzo Stoakes wrote:
On Mon, Jun 30, 2025 at 02:59:45PM +0200, David Hildenbrand wrote:
Currently, any user of page types must clear that type before freeing
a page back to the buddy, otherwise we'll run into mapcount related
sanity checks (because the page type curr
On 30.06.25 18:14, Zi Yan wrote:
On 30 Jun 2025, at 12:01, Lorenzo Stoakes wrote:
On Mon, Jun 30, 2025 at 02:59:46PM +0200, David Hildenbrand wrote:
Let the page freeing code handle clearing the page type.
Why is this advantageous? We want to keep the page marked offline for longer
On 01.07.25 08:13, Harry Yoo wrote:
On Mon, Jun 30, 2025 at 12:14:01PM -0400, Zi Yan wrote:
On 30 Jun 2025, at 12:01, Lorenzo Stoakes wrote:
On Mon, Jun 30, 2025 at 02:59:46PM +0200, David Hildenbrand wrote:
Let the page freeing code handle clearing the page type.
Why is this advantageous
On 30.06.25 17:17, Lorenzo Stoakes wrote:
On Mon, Jun 30, 2025 at 02:59:44PM +0200, David Hildenbrand wrote:
Let's drop these checks; these are conditions the core migration code
must make sure will hold either way, no need to double check.
Acked-by: Zi Yan
Reviewed-by: Sergey Senozh
On 30.06.25 17:15, Lorenzo Stoakes wrote:
On Mon, Jun 30, 2025 at 02:59:43PM +0200, David Hildenbrand wrote:
Let's move the removal of the page from the balloon list into the single
caller, to remove the dependency on the PG_isolated flag and clarify
locking requirements.
We'll s
ack. Add a WARN_ON_ONCE for now.
Signed-off-by: David Hildenbrand
---
include/linux/balloon_compaction.h | 4 +---
mm/balloon_compaction.c| 11 +++
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/include/linux/balloon_compaction.h
b/include/linux/balloon_comp
Let's bring the docs up-to-date.
Reviewed-by: Zi Yan
Signed-off-by: David Hildenbrand
---
Documentation/mm/page_migration.rst | 39 -
1 file changed, 27 insertions(+), 12 deletions(-)
diff --git a/Documentation/mm/page_migration.rst
b/Documentati
Let's bring the docs up-to-date. Setting PG_movable_ops + page->private
very likely still requires to be performed under documented locks:
it's complicated.
We will rework this in the future, as we will try avoiding using the
page lock.
Signed-off-by: David Hildenbrand
---
Now that the mapping flags are only used for folios, let's rename the
defines.
Reviewed-by: Zi Yan
Signed-off-by: David Hildenbrand
---
fs/proc/page.c | 4 ++--
include/linux/fs.h | 2 +-
include/linux/mm_types.h | 1 -
include/linux/page-flags.h
Let's just special-case based on IS_ENABLED(CONFIG_BALLOON_COMPACTION
like we did for balloon_page_finalize().
Signed-off-by: David Hildenbrand
---
include/linux/balloon_compaction.h | 42 +++---
1 file changed, 15 insertions(+), 27 deletions(-)
diff --git a/in
We can now simply check for PageAnon() and remove PageMappingFlags().
... and while at it, use the folio instead and operate on
folio->mapping.
Reviewed-by: Zi Yan
Signed-off-by: David Hildenbrand
---
include/linux/page-flags.h | 5 -
mm/page_alloc.c| 7 +++
2 fi
d-off-by: David Hildenbrand
---
include/linux/mm.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 6a5447bd43fd8..f6ef4c4eb536b 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -2176,13 +2176,13 @@ static inlin
It's unused and the page counterpart is gone, so let's remove it.
Reviewed-by: Zi Yan
Signed-off-by: David Hildenbrand
---
include/linux/page-flags.h | 5 -
1 file changed, 5 deletions(-)
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index f53
KSM is the only remaining user, let's rename the flag. While at it,
adjust to remaining page -> folio in the doc.
Reviewed-by: Zi Yan
Signed-off-by: David Hildenbrand
---
include/linux/page-flags.h | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/inclu
Let's rename the flag to make it clearer where it applies (not folios
...).
While at it, define the flag only with CONFIG_MIGRATION.
Reviewed-by: Zi Yan
Signed-off-by: David Hildenbrand
---
include/linux/page-flags.h | 16 +++-
mm/compaction.c| 2 +-
mm/migr
might result in
false-positive warnings.
Reviewed-by: Zi Yan
Signed-off-by: David Hildenbrand
---
include/linux/balloon_compaction.h | 2 +-
include/linux/migrate.h| 8 -
include/linux/page-flags.h | 52 --
mm/compaction.c
ing movable (having movable_ops), which we will change next.
Reviewed-by: Zi Yan
Signed-off-by: David Hildenbrand
---
include/linux/balloon_compaction.h | 2 +-
include/linux/migrate.h| 14 ++
include/linux/zsmalloc.h | 2 ++
mm/balloon_compactio
ework page_has_movable_ops() soon either way to no longer
rely on page->mapping.
Wherever we cast from folio to page now is a clear sign that this
code has to be decoupled.
Reviewed-by: Zi Yan
Signed-off-by: David Hildenbrand
---
include/linux/page-flags.h | 6 --
mm/migrate.c
Currently, we only support migration of individual movable_ops pages, so
we can not run into that.
Reviewed-by: Zi Yan
Signed-off-by: David Hildenbrand
---
mm/page_isolation.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/page_isolation.c b/mm/page_isolation.c
index
Let's make it clearer that we are talking about movable_ops pages.
While at it, convert a VM_BUG_ON to a VM_WARN_ON_ONCE_PAGE.
Reviewed-by: Zi Yan
Signed-off-by: David Hildenbrand
---
include/linux/migrate.h| 2 +-
include/linux/page-flags.h | 2 +-
mm/compaction.c
PageMovable() into sanity checks for __PageMovable().
Reviewed-by: Zi Yan
Signed-off-by: David Hildenbrand
---
include/linux/migrate.h | 2 --
mm/compaction.c | 15 ---
mm/migrate.c| 18 ++
3 files changed, 10 insertions(+), 25 deletions(-)
diff --git
TODO for that.
Signed-off-by: David Hildenbrand
---
mm/zsmalloc.c | 15 +++
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index f98747aed4330..72c2b7562c511 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -876,7 +876,6 @@ static void reset_
Unused, let's remove it.
The Chinese docs in Documentation/translations/zh_CN/mm/page_migration.rst
still mention it, but that whole docs is destined to get outdated and
updated by somebody that actually speaks that language.
Reviewed-by: Zi Yan
Signed-off-by: David Hildenbrand
---
in
pages)
Reviewed-by: Zi Yan
Signed-off-by: David Hildenbrand
---
mm/migrate.c | 63 +---
1 file changed, 30 insertions(+), 33 deletions(-)
diff --git a/mm/migrate.c b/mm/migrate.c
index 0898ddd2f661f..22c115710d0e2 100644
--- a/mm/migrate.c
+++
Folios will have nothing to do with movable_ops page migration. These
functions are now unused, so let's remove them.
Reviewed-by: Zi Yan
Signed-off-by: David Hildenbrand
---
include/linux/migrate.h | 14 --
1 file changed, 14 deletions(-)
diff --git a/include/linux/migrat
dling flushing
caches if ever required.
Note that we can now change folio_mapping_flags() to folio_test_anon()
to make it clearer, because movable_ops pages will never take that path.
Reviewed-by: Zi Yan
Signed-off-by: David Hildenbrand
---
mm/migrate.c
... and factor the complete handling of movable_ops pages out.
Convert it similar to isolate_movable_ops_page().
While at it, convert the VM_BUG_ON_FOLIO() into a VM_WARN_ON_PAGE().
Signed-off-by: David Hildenbrand
---
mm/migrate.c | 37 -
1 file changed, 24
Yoo
Signed-off-by: David Hildenbrand
---
include/linux/migrate.h | 4 ++--
mm/compaction.c | 2 +-
mm/migrate.c| 39 +--
3 files changed, 32 insertions(+), 13 deletions(-)
diff --git a/include/linux/migrate.h b/include/linux/migrate.h
in
Let the page freeing code handle clearing the page type.
Acked-by: Zi Yan
Reviewed-by: Sergey Senozhatsky
Acked-by: Harry Yoo
Signed-off-by: David Hildenbrand
---
mm/zpdesc.h | 5 -
mm/zsmalloc.c | 3 +--
2 files changed, 1 insertion(+), 7 deletions(-)
diff --git a/mm/zpdesc.h b/mm
Let the page freeing code handle clearing the page type.
Acked-by: Zi Yan
Acked-by: Harry Yoo
Signed-off-by: David Hildenbrand
---
include/linux/balloon_compaction.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/balloon_compaction.h
b/include/linux
n decouple this from the
page lock.
Signed-off-by: David Hildenbrand
---
arch/powerpc/platforms/pseries/cmm.c | 2 +-
drivers/misc/vmw_balloon.c | 3 +-
drivers/virtio/virtio_balloon.c | 4 +--
include/linux/balloon_compaction.h | 43 +++-
mm/balloon_co
Let's drop these checks; these are conditions the core migration code
must make sure will hold either way, no need to double check.
Acked-by: Zi Yan
Reviewed-by: Sergey Senozhatsky
Acked-by: Harry Yoo
Signed-off-by: David Hildenbrand
---
mm/zpdesc.h | 5 -
mm/zsmalloc.c | 5 ---
ransition phase).
In the future we might want to warn on some page types. Instead of
having an "allow list", let's rather wait until we know about once that
should go on such a "disallow list".
Reviewed-by: Zi Yan
Acked-by: Harry Yoo
Signed-off-by: David Hildenbrand
---
ble_ops() checking wrong page
Cc: Andrew Morton
Cc: Jonathan Corbet
Cc: Madhavan Srinivasan
Cc: Michael Ellerman
Cc: Nicholas Piggin
Cc: Christophe Leroy
Cc: Jerrin Shaji George
Cc: Arnd Bergmann
Cc: Greg Kroah-Hartman
Cc: "Michael S. Tsirkin"
Cc: David Hildenbrand
Cc: Jason Wang
The core will set PG_isolated only after mops->isolate_page() was
called. In case of the balloon, that is where we will remove it from
the balloon list. So we cannot have isolated pages in the balloon list.
Let's drop this unnecessary check.
Acked-by: Zi Yan
Signed-off-by: David Hil
On 18.06.25 19:39, David Hildenbrand wrote:
Let's move that handling directly into migrate_folio_move(), so we can
simplify move_to_new_folio(). While at it, fixup the documentation a
bit.
Note that unmap_and_move_huge_page() does not care, because it only
deals with actual folios. (we
@@ -1164,7 +1148,6 @@ static int migrate_folio_unmap(new_folio_t get_new_folio,
int rc = -EAGAIN;
int old_page_state = 0;
struct anon_vma *anon_vma = NULL;
- bool is_lru = data_race(!__folio_test_movable(src));
bool locked = false;
bool dst_locked = fa
1 - 100 of 1323 matches
Mail list logo