[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] xen/mm: reset PFN_ORDER for offlined buddy heads



commit 14c05f26f89d2c1244b02b8071cf22ad7e7208d9
Author:     Bernhard Kaindl <bernhard.kaindl@xxxxxxxxxx>
AuthorDate: Thu Jul 23 10:19:43 2026 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu Jul 23 10:19:43 2026 +0200

    xen/mm: reset PFN_ORDER for offlined buddy heads
    
    Ensure offlined buddy head pages are annotated as order-0 pages.
    
    When a buddy containing pages marked for offlining is processed,
    reserve_offlined_page() rebuilds any surviving healthy buddies
    and moves the offlined subpages onto the offlined lists.
    
    If the buddy head itself is offlined it was previously left
    annotated with the original buddy order even though it has
    been split into a single page.
    
    This has no functional impact as the order of an offlined
    page is not used for any decision making and onlining, but
    it is misleading when inspecting the page's metadata.
    
    Set PFN_ORDER(cur_head) to 0 for all pages moved to the
    lists of offlined and broken pages so the page's stored
    order reflects its actual size.
    
    Signed-off-by: Bernhard Kaindl <bernhard.kaindl@xxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/common/page_alloc.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 40b0f73563..40fdb5fb98 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -1251,6 +1251,12 @@ static int reserve_offlined_page(struct page_info *head)
         ASSERT(total_avail_pages > 0);
         total_avail_pages--;
 
+        /*
+         * All offlined pages are standalone pages: If this offlined page was
+         * the head of a higher-order buddy, reset its order to 0.
+         */
+        PFN_ORDER(cur_head) = 0;
+
         page_list_add_tail(cur_head,
                            test_bit(_PGC_broken, &cur_head->count_info) ?
                            &page_broken_list : &page_offlined_list);
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.