Thread (138 messages) 138 messages, 5 authors, 2025-07-03

Re: [PATCH v1 05/29] mm/balloon_compaction: make PageOffline sticky until the page is freed

From: David Hildenbrand <hidden>
Date: 2025-07-01 08:21:43
Also in: linux-doc, linux-fsdevel, linux-mm, lkml, virtualization

On 30.06.25 18:01, Lorenzo Stoakes wrote:
On Mon, Jun 30, 2025 at 02:59:46PM +0200, David Hildenbrand wrote:
quoted
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 able to identify balloon pages until actually freed is a 
requirement for upcoming movable_ops migration changes."

Note that the documentation is extended in patch #27 to mention that.
quoted
Acked-by: Zi Yan <ziy@nvidia.com>
Acked-by: Harry Yoo <redacted>
Signed-off-by: David Hildenbrand <redacted>
On assumption this UINT_MAX stuff is sane :)) I mean this is straightforward I
guess:
 > > Reviewed-by: Lorenzo Stoakes [off-list ref]
quoted
---
  include/linux/balloon_compaction.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/balloon_compaction.h b/include/linux/balloon_compaction.h
index b9f19da37b089..bfc6e50bd004b 100644
--- a/include/linux/balloon_compaction.h
+++ b/include/linux/balloon_compaction.h
@@ -140,7 +140,7 @@ static inline void balloon_page_finalize(struct page *page)
  		__ClearPageMovable(page);
  		set_page_private(page, 0);
  	}
-	__ClearPageOffline(page);
+	/* PageOffline is sticky until the page is freed to the buddy. */
OK so we are relying on this UINT_MAX thing in free_pages_prepare() to handle this.
Yes. Resetting the page_type -> _mapcount to the initial value -1.

-- 
Cheers,

David / dhildenb

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help