All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] xen/mm: Reset PFN_ORDER for offlined buddy heads
@ 2026-05-28 14:58 Bernhard Kaindl
  2026-05-28 14:58 ` [PATCH 1/2] tools/tests/native: Add test for offlined buddy head PFN_ORDER Bernhard Kaindl
  2026-05-28 14:58 ` [PATCH 2/2] xen/mm: reset PFN_ORDER for offlined buddy heads Bernhard Kaindl
  0 siblings, 2 replies; 5+ messages in thread
From: Bernhard Kaindl @ 2026-05-28 14:58 UTC (permalink / raw)
  To: xen-devel
  Cc: Bernhard Kaindl, Anthony PERARD, Andrew Cooper, Michal Orzel,
	Jan Beulich, Julien Grall, Roger Pau Monné,
	Stefano Stabellini

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@gitlab.com: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@citrix.com>

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



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-06-03 15:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-28 14:58 [PATCH 0/2] xen/mm: Reset PFN_ORDER for offlined buddy heads Bernhard Kaindl
2026-05-28 14:58 ` [PATCH 1/2] tools/tests/native: Add test for offlined buddy head PFN_ORDER Bernhard Kaindl
2026-05-28 14:58 ` [PATCH 2/2] xen/mm: reset PFN_ORDER for offlined buddy heads Bernhard Kaindl
2026-06-02 15:57   ` Jan Beulich
2026-06-03 15:10     ` Bernhard Kaindl

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.