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/balloon_compaction: move internal helpers to balloon_compaction.c

Let's move the helpers that are not required by drivers anymore.

While at it, drop the doc of balloon_page_device() as it is trivial.

[david@kernel.org: move balloon_page_device() under CONFIG_BALLOON_COMPACTION]
Link: https://lkml.kernel.org/r/27f0adf1-54c1-4d99-8b7f-fd45574e7f41@kernel.org
Link: https://lkml.kernel.org/r/20260119230133.3551867-16-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
03d6a2f6 9d792ef3

+37 -44
-44
include/linux/balloon_compaction.h
··· 75 75 balloon->migratepage = NULL; 76 76 balloon->adjust_managed_page_count = false; 77 77 } 78 - 79 - #ifdef CONFIG_BALLOON_COMPACTION 80 - /* 81 - * balloon_page_device - get the b_dev_info descriptor for the balloon device 82 - * that enqueues the given page. 83 - */ 84 - static inline struct balloon_dev_info *balloon_page_device(struct page *page) 85 - { 86 - return (struct balloon_dev_info *)page_private(page); 87 - } 88 - #endif /* CONFIG_BALLOON_COMPACTION */ 89 - 90 - /* 91 - * balloon_page_insert - insert a page into the balloon's page list and make 92 - * the page->private assignment accordingly. 93 - * @balloon : pointer to balloon device 94 - * @page : page to be assigned as a 'balloon page' 95 - * 96 - * Caller must ensure the balloon_pages_lock is held. 97 - */ 98 - static inline void balloon_page_insert(struct balloon_dev_info *balloon, 99 - struct page *page) 100 - { 101 - __SetPageOffline(page); 102 - if (IS_ENABLED(CONFIG_BALLOON_COMPACTION)) { 103 - SetPageMovableOps(page); 104 - set_page_private(page, (unsigned long)balloon); 105 - } 106 - list_add(&page->lru, &balloon->pages); 107 - } 108 - 109 - /* 110 - * balloon_page_finalize - prepare a balloon page that was removed from the 111 - * balloon list for release to the page allocator 112 - * @page: page to be released to the page allocator 113 - * 114 - * Caller must ensure the balloon_pages_lock is held. 115 - */ 116 - static inline void balloon_page_finalize(struct page *page) 117 - { 118 - if (IS_ENABLED(CONFIG_BALLOON_COMPACTION)) 119 - set_page_private(page, 0); 120 - /* PageOffline is sticky until the page is freed to the buddy. */ 121 - } 122 78 #endif /* _LINUX_BALLOON_COMPACTION_H */
+37
mm/balloon_compaction.c
··· 17 17 */ 18 18 static DEFINE_SPINLOCK(balloon_pages_lock); 19 19 20 + /* 21 + * balloon_page_insert - insert a page into the balloon's page list and make 22 + * the page->private assignment accordingly. 23 + * @balloon : pointer to balloon device 24 + * @page : page to be assigned as a 'balloon page' 25 + * 26 + * Caller must ensure the balloon_pages_lock is held. 27 + */ 28 + static void balloon_page_insert(struct balloon_dev_info *balloon, 29 + struct page *page) 30 + { 31 + __SetPageOffline(page); 32 + if (IS_ENABLED(CONFIG_BALLOON_COMPACTION)) { 33 + SetPageMovableOps(page); 34 + set_page_private(page, (unsigned long)balloon); 35 + } 36 + list_add(&page->lru, &balloon->pages); 37 + } 38 + 39 + /* 40 + * balloon_page_finalize - prepare a balloon page that was removed from the 41 + * balloon list for release to the page allocator 42 + * @page: page to be released to the page allocator 43 + * 44 + * Caller must ensure the balloon_pages_lock is held. 45 + */ 46 + static void balloon_page_finalize(struct page *page) 47 + { 48 + if (IS_ENABLED(CONFIG_BALLOON_COMPACTION)) 49 + set_page_private(page, 0); 50 + /* PageOffline is sticky until the page is freed to the buddy. */ 51 + } 52 + 20 53 static void balloon_page_enqueue_one(struct balloon_dev_info *b_dev_info, 21 54 struct page *page) 22 55 { ··· 227 194 EXPORT_SYMBOL_GPL(balloon_page_dequeue); 228 195 229 196 #ifdef CONFIG_BALLOON_COMPACTION 197 + static struct balloon_dev_info *balloon_page_device(struct page *page) 198 + { 199 + return (struct balloon_dev_info *)page_private(page); 200 + } 230 201 231 202 static bool balloon_page_isolate(struct page *page, isolate_mode_t mode) 232 203