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:11:17
Also in: linux-doc, linux-fsdevel, linux-mm, linuxppc-dev, lkml

On 01.07.25 08:13, Harry Yoo wrote:
On Mon, Jun 30, 2025 at 12:14:01PM -0400, Zi Yan wrote:
quoted
On 30 Jun 2025, at 12:01, Lorenzo Stoakes wrote:
quoted
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?
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:
This is how page type is cleared.
See: https://elixir.bootlin.com/linux/v6.15.4/source/include/linux/page-flags.h#L1013.

I agree with you that patch 4 should have a comment in free_pages_prepare()
about what the code is for and why UINT_MAX is used.
Or instead of comment, maybe something like this:

/* Clear any page type */
static __always_inline void __ClearPageType(struct page *page)
{
	VM_WARN_ON_ONCE_PAGE(!page_has_type(page), page);
	page->page_type = UINT_MAX;
}

in patch 4:

if (unlikely(page_has_type(page)))
	__ClearPageType(page);
I don't think we should do that. It's very specialized code that nobody 
should be reusing.

And it will all change once Willy reworks the page_type vs. _mapcount 
overlay.

-- 
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