From: Jan Beulich <jbeulich@suse.com>
To: Roger Pau Monne <roger@xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
Anthony PERARD <anthony.perard@vates.tech>,
Michal Orzel <michal.orzel@amd.com>,
Julien Grall <julien@xen.org>,
Stefano Stabellini <sstabellini@kernel.org>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH] x86/mm: limit deferred TLB flushing to PV owned pages
Date: Wed, 9 Sep 2026 11:21:51 +0200 [thread overview]
Message-ID: <1cadfc6c-efc1-4e23-b778-1df97fd0fa4d@suse.com> (raw)
In-Reply-To: <20260909072451.67324-1-roger@xenproject.org>
On 09.09.2026 09:24, Roger Pau Monne wrote:
> The current logic on x86 will mark all domain owned pages as needed a TLB
> flush before being re-used. However such TLB flushing is only strictly
> needed for PV domain owned pages, as those can keep a reference to the page
> in the TLB after it has been freed.
What about HVM-owned ones which a PV domain has grant- or foreign-mapped?
> --- a/xen/common/page_alloc.c
> +++ b/xen/common/page_alloc.c
> @@ -1501,6 +1501,7 @@ bool scrub_free_pages(void)
>
> static bool mark_page_free(struct page_info *pg, mfn_t mfn)
> {
> + const struct domain *owner = page_get_owner(pg);
> bool pg_offlined = false;
>
> ASSERT(mfn_x(mfn) == mfn_x(page_to_mfn(pg)));
> @@ -1539,7 +1540,7 @@ static bool mark_page_free(struct page_info *pg, mfn_t mfn)
> }
>
> /* If a page has no owner it will need no safety TLB flush. */
> - pg->u.free.need_tlbflush = (page_get_owner(pg) != NULL);
> + pg->u.free.need_tlbflush = owner && is_pv_domain(owner);
> if ( pg->u.free.need_tlbflush )
> page_set_tlbflush_timestamp(pg);
Imo whichever change it is going to be here, it definitely also requires
the comment to be kept in sync.
Jan
next prev parent reply other threads:[~2026-09-09 9:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-09 7:24 [PATCH] x86/mm: limit deferred TLB flushing to PV owned pages Roger Pau Monne
2026-09-09 9:21 ` Jan Beulich [this message]
2026-09-09 9:58 ` Andrew Cooper
2026-09-09 13:09 ` Roger Pau Monné
2026-09-09 13:26 ` Jan Beulich
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=1cadfc6c-efc1-4e23-b778-1df97fd0fa4d@suse.com \
--to=jbeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=roger@xenproject.org \
--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.