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

[PATCH 0/2] xen/mm: Reset PFN_ORDER for offlined buddy heads



This series fixes an inconsistency in the PFN_ORDER annotation for
pages that are offlined when they are the head of a free buddy.

When reserve_offlined_page() splits a buddy and moves offlined
sub-pages to the offlined lists, the former buddy head would be
left annotated with its original order even though it is now a
single page. While this does not cause functional regressions,
it is misleading.

Patch 1 adds a native regression test that reproduces and documents
the problem. The test seeds an order-1 buddy, offlines the head page,
verifies the tail becomes order-0, and checks the offlined head's order.

Patch 2 resets PFN_ORDER to 0 for offlined buddy heads inside
reserve_offlined_page() when moving the page to the offlined list
and updates the regression test to assert the corrected behaviour.

This series is based on the native test environment v3 for NUMA claims
https://lists.xen.org/archives/html/xen-devel/2026-05/msg01163.html

which in turn is based on the NUMA claim sets v7 series:
https://lists.xen.org/archives/html/xen-devel/2026-05/msg00363.html
Please help to review and ack it (It should be eligible for Xen 4.22)

Pull this series with all dependencies for review/test:

$ git pull git@xxxxxxxxxx:bernhardkaindl/xen.git offline-head-order

$ make -C tools/tests/native TARGETS=offline-head-order test |
      grep -C3 PG_OFFLINE_STATUS_OFFLINED

Log of checking the PFN_ORDER() of the offlined page before the fix is applied:

| offline-head-order.c:32: ASSERT(PFN_ORDER(page) == 1)
| offline-head-order.c:34: ASSERT(offline_page(page_to_mfn(page), 0, &status) 
== 0)
| offline-head-order.c:35: ASSERT(status == PG_OFFLINE_OFFLINED)
| offline-head-order.c:39: ASSERT(query_page_offline(page_to_mfn(page), 
&status) == 0)
| offline-head-order.c:40: ASSERT(status == PG_OFFLINE_STATUS_OFFLINED)
|
| - Test assertion failed as expected at offline-head-order.c:44:
|   Assertion failed: PFN_ORDER(page) == 0

Signed-off-by: Bernhard Kaindl <bernhard.kaindl@xxxxxxxxxx>

Bernhard Kaindl (2):
  tools/tests/native: Add test for offlined buddy head PFN_ORDER
  xen/mm: reset PFN_ORDER for offlined buddy heads

 tools/tests/native/offline-head-order.c | 79 +++++++++++++++++++++++++
 xen/common/page_alloc.c                 |  7 +++
 2 files changed, 86 insertions(+)
 create mode 100644 tools/tests/native/offline-head-order.c

-- 
2.39.5




 


Rackspace

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