Re: [PATCH v2 21/23] mm: rename CONFIG_BALLOON_COMPACTION to CONFIG_BALLOON_MIGRATION
On Thu, Jan 15, 2026 at 10:20:11AM +0100, David Hildenbrand (Red Hat) wrote:
> While compaction depends on migration, the other direction is not the
> case. So let's make it clearer that this is all about migration of
> balloon pages.
>
> Adjust all comments/docs in the core to talk about "migration" instead
> of "compaction".
Saw:
include/linux/balloon.h:25: * performing balloon page compaction. In order to
sort out these racy scenarios
include/linux/balloon.h:26: * and safely perform balloon's page compaction and
migration we must, always,
Documentation/mm/page_migration.rst:175:balloon-compaction infrastructure
residing in the core kernel.
At this commit so maybe a few more to chase up?
>
> While at it add some "/* CONFIG_BALLOON_MIGRATION */".
>
> Signed-off-by: David Hildenbrand (Red Hat)
Otherwise LGTM, so:
Reviewed-by: Lorenzo Stoakes
> ---
> Documentation/admin-guide/mm/memory-hotplug.rst | 8
> arch/powerpc/platforms/pseries/cmm.c| 8
> drivers/misc/vmw_balloon.c | 8
> drivers/virtio/virtio_balloon.c | 6 +++---
> include/linux/balloon.h | 2 +-
> include/linux/vm_event_item.h | 4 ++--
> mm/Kconfig | 4 ++--
> mm/balloon.c| 10 +-
> mm/memory_hotplug.c | 4 ++--
> mm/migrate.c| 2 +-
> mm/vmstat.c | 4 ++--
> 11 files changed, 30 insertions(+), 30 deletions(-)
>
> diff --git a/Documentation/admin-guide/mm/memory-hotplug.rst
> b/Documentation/admin-guide/mm/memory-hotplug.rst
> index 6581558fd0d7a..0207f87251421 100644
> --- a/Documentation/admin-guide/mm/memory-hotplug.rst
> +++ b/Documentation/admin-guide/mm/memory-hotplug.rst
> @@ -603,11 +603,11 @@ ZONE_MOVABLE, especially when fine-tuning zone ratios:
>memory for metadata and page tables in the direct map; having a lot of
> offline
>memory blocks is not a typical case, though.
>
> -- Memory ballooning without balloon compaction is incompatible with
> - ZONE_MOVABLE. Only some implementations, such as virtio-balloon and
> - pseries CMM, fully support balloon compaction.
> +- Memory ballooning without support for balloon memory migration is
> incompatible
> + with ZONE_MOVABLE. Only some implementations, such as virtio-balloon and
> + pseries CMM, fully support balloon memory migration.
>
> - Further, the CONFIG_BALLOON_COMPACTION kernel configuration option might be
> + Further, the CONFIG_BALLOON_MIGRATION kernel configuration option might be
>disabled. In that case, balloon inflation will only perform unmovable
>allocations and silently create a zone imbalance, usually triggered by
>inflation requests from the hypervisor.
> diff --git a/arch/powerpc/platforms/pseries/cmm.c
> b/arch/powerpc/platforms/pseries/cmm.c
> index 7a3c4922685ab..8d83df12430f2 100644
> --- a/arch/powerpc/platforms/pseries/cmm.c
> +++ b/arch/powerpc/platforms/pseries/cmm.c
> @@ -494,7 +494,7 @@ static struct notifier_block cmm_mem_nb = {
> .priority = CMM_MEM_HOTPLUG_PRI
> };
>
> -#ifdef CONFIG_BALLOON_COMPACTION
> +#ifdef CONFIG_BALLOON_MIGRATION
> static int cmm_migratepage(struct balloon_dev_info *b_dev_info,
> struct page *newpage, struct page *page,
> enum migrate_mode mode)
> @@ -520,10 +520,10 @@ static int cmm_migratepage(struct balloon_dev_info
> *b_dev_info,
> plpar_page_set_active(page);
> return 0;
> }
> -#else /* CONFIG_BALLOON_COMPACTION */
> +#else /* CONFIG_BALLOON_MIGRATION */
> int cmm_migratepage(struct balloon_dev_info *b_dev_info, struct page
> *newpage,
> struct page *page, enum migrate_mode mode);
> -#endif /* CONFIG_BALLOON_COMPACTION */
> +#endif /* CONFIG_BALLOON_MIGRATION */
>
> /**
> * cmm_init - Module initialization
> @@ -540,7 +540,7 @@ static int cmm_init(void)
>
> balloon_devinfo_init(&b_dev_info);
> b_dev_info.adjust_managed_page_count = true;
> - if (IS_ENABLED(CONFIG_BALLOON_COMPACTION))
> + if (IS_ENABLED(CONFIG_BALLOON_MIGRATION))
> b_dev_info.migratepage = cmm_migratepage;
>
> rc = register_oom_notifier(&cmm_oom_nb);
> diff --git a/drivers/misc/vmw_balloon.c b/drivers/misc/vmw_balloon.c
> index 7fd3f709108c2..216a163959684 100644
> --- a/drivers/misc/vmw_balloon.c
> +++ b/drivers/misc/vmw_balloon.c
> @@ -1719,7 +1719,7 @@ static inline void vmballoon_debugfs_exit(struct
> vmballoon *b)
> #endif /* CONFIG_DEBUG_FS */
>
>
> -#ifdef CONFIG_BALLOON_COMPACTION
> +#ifdef CONFIG_BALLOON_MIGRATION
> /**
> * vmballoon_migratepage() - migrates a balloon page.
> * @b_dev_info: balloon device information descriptor.
> @@ -1803,11 +1803,11 @@ static int vmballoon_migratepage(struct
> balloon_dev_info *b_dev_info,
> up_read(&b->conf_sem);
>
[PATCH v2 21/23] mm: rename CONFIG_BALLOON_COMPACTION to CONFIG_BALLOON_MIGRATION
While compaction depends on migration, the other direction is not the
case. So let's make it clearer that this is all about migration of
balloon pages.
Adjust all comments/docs in the core to talk about "migration" instead
of "compaction".
While at it add some "/* CONFIG_BALLOON_MIGRATION */".
Signed-off-by: David Hildenbrand (Red Hat)
---
Documentation/admin-guide/mm/memory-hotplug.rst | 8
arch/powerpc/platforms/pseries/cmm.c| 8
drivers/misc/vmw_balloon.c | 8
drivers/virtio/virtio_balloon.c | 6 +++---
include/linux/balloon.h | 2 +-
include/linux/vm_event_item.h | 4 ++--
mm/Kconfig | 4 ++--
mm/balloon.c| 10 +-
mm/memory_hotplug.c | 4 ++--
mm/migrate.c| 2 +-
mm/vmstat.c | 4 ++--
11 files changed, 30 insertions(+), 30 deletions(-)
diff --git a/Documentation/admin-guide/mm/memory-hotplug.rst
b/Documentation/admin-guide/mm/memory-hotplug.rst
index 6581558fd0d7a..0207f87251421 100644
--- a/Documentation/admin-guide/mm/memory-hotplug.rst
+++ b/Documentation/admin-guide/mm/memory-hotplug.rst
@@ -603,11 +603,11 @@ ZONE_MOVABLE, especially when fine-tuning zone ratios:
memory for metadata and page tables in the direct map; having a lot of
offline
memory blocks is not a typical case, though.
-- Memory ballooning without balloon compaction is incompatible with
- ZONE_MOVABLE. Only some implementations, such as virtio-balloon and
- pseries CMM, fully support balloon compaction.
+- Memory ballooning without support for balloon memory migration is
incompatible
+ with ZONE_MOVABLE. Only some implementations, such as virtio-balloon and
+ pseries CMM, fully support balloon memory migration.
- Further, the CONFIG_BALLOON_COMPACTION kernel configuration option might be
+ Further, the CONFIG_BALLOON_MIGRATION kernel configuration option might be
disabled. In that case, balloon inflation will only perform unmovable
allocations and silently create a zone imbalance, usually triggered by
inflation requests from the hypervisor.
diff --git a/arch/powerpc/platforms/pseries/cmm.c
b/arch/powerpc/platforms/pseries/cmm.c
index 7a3c4922685ab..8d83df12430f2 100644
--- a/arch/powerpc/platforms/pseries/cmm.c
+++ b/arch/powerpc/platforms/pseries/cmm.c
@@ -494,7 +494,7 @@ static struct notifier_block cmm_mem_nb = {
.priority = CMM_MEM_HOTPLUG_PRI
};
-#ifdef CONFIG_BALLOON_COMPACTION
+#ifdef CONFIG_BALLOON_MIGRATION
static int cmm_migratepage(struct balloon_dev_info *b_dev_info,
struct page *newpage, struct page *page,
enum migrate_mode mode)
@@ -520,10 +520,10 @@ static int cmm_migratepage(struct balloon_dev_info
*b_dev_info,
plpar_page_set_active(page);
return 0;
}
-#else /* CONFIG_BALLOON_COMPACTION */
+#else /* CONFIG_BALLOON_MIGRATION */
int cmm_migratepage(struct balloon_dev_info *b_dev_info, struct page *newpage,
struct page *page, enum migrate_mode mode);
-#endif /* CONFIG_BALLOON_COMPACTION */
+#endif /* CONFIG_BALLOON_MIGRATION */
/**
* cmm_init - Module initialization
@@ -540,7 +540,7 @@ static int cmm_init(void)
balloon_devinfo_init(&b_dev_info);
b_dev_info.adjust_managed_page_count = true;
- if (IS_ENABLED(CONFIG_BALLOON_COMPACTION))
+ if (IS_ENABLED(CONFIG_BALLOON_MIGRATION))
b_dev_info.migratepage = cmm_migratepage;
rc = register_oom_notifier(&cmm_oom_nb);
diff --git a/drivers/misc/vmw_balloon.c b/drivers/misc/vmw_balloon.c
index 7fd3f709108c2..216a163959684 100644
--- a/drivers/misc/vmw_balloon.c
+++ b/drivers/misc/vmw_balloon.c
@@ -1719,7 +1719,7 @@ static inline void vmballoon_debugfs_exit(struct
vmballoon *b)
#endif /* CONFIG_DEBUG_FS */
-#ifdef CONFIG_BALLOON_COMPACTION
+#ifdef CONFIG_BALLOON_MIGRATION
/**
* vmballoon_migratepage() - migrates a balloon page.
* @b_dev_info: balloon device information descriptor.
@@ -1803,11 +1803,11 @@ static int vmballoon_migratepage(struct
balloon_dev_info *b_dev_info,
up_read(&b->conf_sem);
return ret;
}
-#else /* CONFIG_BALLOON_COMPACTION */
+#else /* CONFIG_BALLOON_MIGRATION */
int vmballoon_migratepage(struct balloon_dev_info *b_dev_info,
struct page *newpage, struct page *page,
enum migrate_mode mode);
-#endif /* CONFIG_BALLOON_COMPACTION */
+#endif /* CONFIG_BALLOON_MIGRATION */
static int __init vmballoon_init(void)
{
@@ -1827,7 +1827,7 @@ static int __init vmballoon_init(void)
return error;
balloon_devinfo_init(&balloon.b_dev_info);
- if (IS_ENABLED(CONFIG_BALLOON_COMPACTION))
+ if (IS_ENABLED(CONFIG_BALLOON_MIGRATION))
balloon.b_dev
