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 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 */".

Link: https://lkml.kernel.org/r/20260119230133.3551867-23-david@kernel.org
Signed-off-by: David Hildenbrand (Red Hat) <david@kernel.org>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Eugenio Pérez <eperezma@redhat.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jason Wang <jasowang@redhat.com>
Cc: Jerrin Shaji George <jerrin.shaji-george@broadcom.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: SeongJae Park <sj@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Cc: Zi Yan <ziy@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

David Hildenbrand (Red Hat) and committed by
Andrew Morton
cd8e95d8 7cf3318a

+35 -35
+4 -4
Documentation/admin-guide/mm/memory-hotplug.rst
··· 603 603 memory for metadata and page tables in the direct map; having a lot of offline 604 604 memory blocks is not a typical case, though. 605 605 606 - - Memory ballooning without balloon compaction is incompatible with 607 - ZONE_MOVABLE. Only some implementations, such as virtio-balloon and 608 - pseries CMM, fully support balloon compaction. 606 + - Memory ballooning without support for balloon memory migration is incompatible 607 + with ZONE_MOVABLE. Only some implementations, such as virtio-balloon and 608 + pseries CMM, fully support balloon memory migration. 609 609 610 - Further, the CONFIG_BALLOON_COMPACTION kernel configuration option might be 610 + Further, the CONFIG_BALLOON_MIGRATION kernel configuration option might be 611 611 disabled. In that case, balloon inflation will only perform unmovable 612 612 allocations and silently create a zone imbalance, usually triggered by 613 613 inflation requests from the hypervisor.
+4 -4
arch/powerpc/platforms/pseries/cmm.c
··· 494 494 .priority = CMM_MEM_HOTPLUG_PRI 495 495 }; 496 496 497 - #ifdef CONFIG_BALLOON_COMPACTION 497 + #ifdef CONFIG_BALLOON_MIGRATION 498 498 static int cmm_migratepage(struct balloon_dev_info *b_dev_info, 499 499 struct page *newpage, struct page *page, 500 500 enum migrate_mode mode) ··· 520 520 plpar_page_set_active(page); 521 521 return 0; 522 522 } 523 - #else /* CONFIG_BALLOON_COMPACTION */ 523 + #else /* CONFIG_BALLOON_MIGRATION */ 524 524 int cmm_migratepage(struct balloon_dev_info *b_dev_info, struct page *newpage, 525 525 struct page *page, enum migrate_mode mode); 526 - #endif /* CONFIG_BALLOON_COMPACTION */ 526 + #endif /* CONFIG_BALLOON_MIGRATION */ 527 527 528 528 /** 529 529 * cmm_init - Module initialization ··· 540 540 541 541 balloon_devinfo_init(&b_dev_info); 542 542 b_dev_info.adjust_managed_page_count = true; 543 - if (IS_ENABLED(CONFIG_BALLOON_COMPACTION)) 543 + if (IS_ENABLED(CONFIG_BALLOON_MIGRATION)) 544 544 b_dev_info.migratepage = cmm_migratepage; 545 545 546 546 rc = register_oom_notifier(&cmm_oom_nb);
+4 -4
drivers/misc/vmw_balloon.c
··· 1719 1719 #endif /* CONFIG_DEBUG_FS */ 1720 1720 1721 1721 1722 - #ifdef CONFIG_BALLOON_COMPACTION 1722 + #ifdef CONFIG_BALLOON_MIGRATION 1723 1723 /** 1724 1724 * vmballoon_migratepage() - migrates a balloon page. 1725 1725 * @b_dev_info: balloon device information descriptor. ··· 1803 1803 up_read(&b->conf_sem); 1804 1804 return ret; 1805 1805 } 1806 - #else /* CONFIG_BALLOON_COMPACTION */ 1806 + #else /* CONFIG_BALLOON_MIGRATION */ 1807 1807 int vmballoon_migratepage(struct balloon_dev_info *b_dev_info, 1808 1808 struct page *newpage, struct page *page, 1809 1809 enum migrate_mode mode); 1810 - #endif /* CONFIG_BALLOON_COMPACTION */ 1810 + #endif /* CONFIG_BALLOON_MIGRATION */ 1811 1811 1812 1812 static int __init vmballoon_init(void) 1813 1813 { ··· 1827 1827 return error; 1828 1828 1829 1829 balloon_devinfo_init(&balloon.b_dev_info); 1830 - if (IS_ENABLED(CONFIG_BALLOON_COMPACTION)) 1830 + if (IS_ENABLED(CONFIG_BALLOON_MIGRATION)) 1831 1831 balloon.b_dev_info.migratepage = vmballoon_migratepage; 1832 1832 1833 1833 INIT_LIST_HEAD(&balloon.huge_pages);
+3 -3
drivers/virtio/virtio_balloon.c
··· 802 802 } 803 803 } 804 804 805 - #ifdef CONFIG_BALLOON_COMPACTION 805 + #ifdef CONFIG_BALLOON_MIGRATION 806 806 /* 807 807 * virtballoon_migratepage - perform the balloon page migration on behalf of 808 808 * a compaction thread. (called under page lock) ··· 851 851 mutex_unlock(&vb->balloon_lock); 852 852 return 0; 853 853 } 854 - #endif /* CONFIG_BALLOON_COMPACTION */ 854 + #endif /* CONFIG_BALLOON_MIGRATION */ 855 855 856 856 static unsigned long shrink_free_pages(struct virtio_balloon *vb, 857 857 unsigned long pages_to_free) ··· 948 948 949 949 if (!virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_DEFLATE_ON_OOM)) 950 950 vb->vb_dev_info.adjust_managed_page_count = true; 951 - #ifdef CONFIG_BALLOON_COMPACTION 951 + #ifdef CONFIG_BALLOON_MIGRATION 952 952 vb->vb_dev_info.migratepage = virtballoon_migratepage; 953 953 #endif 954 954 if (virtio_has_feature(vdev, VIRTIO_BALLOON_F_FREE_PAGE_HINT)) {
+6 -6
include/linux/balloon.h
··· 22 22 * 23 23 * As the page isolation scanning step a compaction thread does is a lockless 24 24 * procedure (from a page standpoint), it might bring some racy situations while 25 - * performing balloon page compaction. In order to sort out these racy scenarios 26 - * and safely perform balloon's page compaction and migration we must, always, 27 - * ensure following these simple rules: 25 + * performing balloon page migration. In order to sort out these racy scenarios 26 + * and safely perform balloon's page migration we must, always, ensure following 27 + * these simple rules: 28 28 * 29 29 * i. Inflation/deflation must set/clear page->private under the 30 30 * balloon_pages_lock ··· 45 45 46 46 /* 47 47 * Balloon device information descriptor. 48 - * This struct is used to allow the common balloon compaction interface 48 + * This struct is used to allow the common balloon page migration interface 49 49 * procedures to find the proper balloon device holding memory pages they'll 50 - * have to cope for page compaction / migration, as well as it serves the 51 - * balloon driver as a page book-keeper for its registered balloon devices. 50 + * have to cope for page migration, as well as it serves the balloon driver as 51 + * a page book-keeper for its registered balloon devices. 52 52 */ 53 53 struct balloon_dev_info { 54 54 unsigned long isolated_pages; /* # of isolated pages for migration */
+2 -2
include/linux/vm_event_item.h
··· 125 125 #ifdef CONFIG_MEMORY_BALLOON 126 126 BALLOON_INFLATE, 127 127 BALLOON_DEFLATE, 128 - #ifdef CONFIG_BALLOON_COMPACTION 128 + #ifdef CONFIG_BALLOON_MIGRATION 129 129 BALLOON_MIGRATE, 130 - #endif 130 + #endif /* CONFIG_BALLOON_MIGRATION */ 131 131 #endif 132 132 #ifdef CONFIG_DEBUG_TLBFLUSH 133 133 NR_TLB_REMOTE_FLUSH, /* cpu tried to flush others' tlbs */
+2 -2
mm/Kconfig
··· 597 597 bool 598 598 599 599 # 600 - # support for memory balloon compaction 601 - config BALLOON_COMPACTION 600 + # support for memory balloon page migration 601 + config BALLOON_MIGRATION 602 602 bool "Allow for balloon memory migration" 603 603 default y 604 604 depends on MIGRATION && MEMORY_BALLOON
+5 -5
mm/balloon.c
··· 29 29 { 30 30 lockdep_assert_held(&balloon_pages_lock); 31 31 __SetPageOffline(page); 32 - if (IS_ENABLED(CONFIG_BALLOON_COMPACTION)) { 32 + if (IS_ENABLED(CONFIG_BALLOON_MIGRATION)) { 33 33 SetPageMovableOps(page); 34 34 set_page_private(page, (unsigned long)balloon); 35 35 } ··· 46 46 static void balloon_page_finalize(struct page *page) 47 47 { 48 48 lockdep_assert_held(&balloon_pages_lock); 49 - if (IS_ENABLED(CONFIG_BALLOON_COMPACTION)) 49 + if (IS_ENABLED(CONFIG_BALLOON_MIGRATION)) 50 50 set_page_private(page, 0); 51 51 /* PageOffline is sticky until the page is freed to the buddy. */ 52 52 } ··· 148 148 { 149 149 gfp_t gfp_flags = __GFP_NOMEMALLOC | __GFP_NORETRY | __GFP_NOWARN; 150 150 151 - if (IS_ENABLED(CONFIG_BALLOON_COMPACTION)) 151 + if (IS_ENABLED(CONFIG_BALLOON_MIGRATION)) 152 152 gfp_flags |= GFP_HIGHUSER_MOVABLE; 153 153 else 154 154 gfp_flags |= GFP_HIGHUSER; ··· 227 227 } 228 228 EXPORT_SYMBOL_GPL(balloon_page_dequeue); 229 229 230 - #ifdef CONFIG_BALLOON_COMPACTION 230 + #ifdef CONFIG_BALLOON_MIGRATION 231 231 static struct balloon_dev_info *balloon_page_device(struct page *page) 232 232 { 233 233 return (struct balloon_dev_info *)page_private(page); ··· 341 341 } 342 342 core_initcall(balloon_init); 343 343 344 - #endif /* CONFIG_BALLOON_COMPACTION */ 344 + #endif /* CONFIG_BALLOON_MIGRATION */
+2 -2
mm/memory_hotplug.c
··· 946 946 * We rely on "present pages" instead of "managed pages", as the latter is 947 947 * highly unreliable and dynamic in virtualized environments, and does not 948 948 * consider boot time allocations. For example, memory ballooning adjusts the 949 - * managed pages when inflating/deflating the balloon, and balloon compaction 950 - * can even migrate inflated pages between zones. 949 + * managed pages when inflating/deflating the balloon, and balloon page 950 + * migration can even migrate inflated pages between zones. 951 951 * 952 952 * Using "present pages" is better but some things to keep in mind are: 953 953 *
+1 -1
mm/migrate.c
··· 88 88 * back to the buddy. 89 89 */ 90 90 if (PageOffline(page)) 91 - /* Only balloon compaction sets PageOffline pages movable. */ 91 + /* Only balloon page migration sets PageOffline pages movable. */ 92 92 return offline_movable_ops; 93 93 if (PageZsmalloc(page)) 94 94 return zsmalloc_movable_ops;
+2 -2
mm/vmstat.c
··· 1422 1422 #ifdef CONFIG_MEMORY_BALLOON 1423 1423 [I(BALLOON_INFLATE)] = "balloon_inflate", 1424 1424 [I(BALLOON_DEFLATE)] = "balloon_deflate", 1425 - #ifdef CONFIG_BALLOON_COMPACTION 1425 + #ifdef CONFIG_BALLOON_MIGRATION 1426 1426 [I(BALLOON_MIGRATE)] = "balloon_migrate", 1427 - #endif 1427 + #endif /* CONFIG_BALLOON_MIGRATION */ 1428 1428 #endif /* CONFIG_MEMORY_BALLOON */ 1429 1429 #ifdef CONFIG_DEBUG_TLBFLUSH 1430 1430 [I(NR_TLB_REMOTE_FLUSH)] = "nr_tlb_remote_flush",