From: Bernhard Kaindl <bernhard.kaindl@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: "Bernhard Kaindl" <bernhard.kaindl@citrix.com>,
"Anthony PERARD" <anthony.perard@vates.tech>,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"Michal Orzel" <michal.orzel@amd.com>,
"Jan Beulich" <jbeulich@suse.com>,
"Julien Grall" <julien@xen.org>,
"Roger Pau Monné" <roger.pau@citrix.com>,
"Stefano Stabellini" <sstabellini@kernel.org>
Subject: [PATCH 0/2] xen/mm: Reset PFN_ORDER for offlined buddy heads
Date: Thu, 28 May 2026 15:58:19 +0100 [thread overview]
Message-ID: <cover.1779980244.git.bernhard.kaindl@citrix.com> (raw)
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
next reply other threads:[~2026-05-28 15:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-28 14:58 Bernhard Kaindl [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1779980244.git.bernhard.kaindl@citrix.com \
--to=bernhard.kaindl@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.