From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH 1/3] x86/shadow: unlock P2M slightly earlier in shadow_track_dirty_vram()
Date: Mon, 27 Apr 2026 10:47:23 +0200 [thread overview]
Message-ID: <ae8im__1Wrn420MH@macbook.local> (raw)
In-Reply-To: <c6aa40de-11b2-4725-b18c-8a982e43f0f0@suse.com>
On Tue, Feb 03, 2026 at 05:49:35PM +0100, Jan Beulich wrote:
> There's no need to call vfree() with the lock still held.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
> ---
> In fact for the purposes of the function the P2M lock could really be
> obtained merely in read mode, and it could be dropped immediately in both
> the main "if()" and its "else if()". If only there wasn't the error
> handling after copy_to_guest(): Dropping the paging lock ahead of that
> call, we rely solely on the P2M lock to also guard the changing of
> d->arch.hvm.dirty_vram.sh and what it points to. Question is why dropping
> the paging lock (but continuing to hold the P2M lock) is necessary there
> in the first place.
I wouldn't spend a lot of time trying to optimize this, we already
know HVM shadow is ATM not very optimized, and generally recommend
HAP.
If we could turn the p2m lock into read-mode, maybe at the expense of
expanding the paging locked region that would likely be slightly better?
Thanks, Roger.
next prev parent reply other threads:[~2026-04-27 8:47 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-03 16:47 [PATCH 0/3] x86/shadow: tidy VRAM tracking a little Jan Beulich
2026-02-03 16:49 ` [PATCH 1/3] x86/shadow: unlock P2M slightly earlier in shadow_track_dirty_vram() Jan Beulich
2026-04-27 8:47 ` Roger Pau Monné [this message]
2026-05-04 8:21 ` Jan Beulich
2026-02-03 16:49 ` [PATCH 2/3] x86/shadow: VRAM last_dirty tagging Jan Beulich
2026-04-27 9:28 ` Roger Pau Monné
2026-05-04 8:39 ` Jan Beulich
2026-05-20 13:54 ` Roger Pau Monné
2026-05-20 14:25 ` Jan Beulich
2026-02-03 16:50 ` [PATCH 3/3] x86/shadow: reduce flush_tlb's scope in shadow_track_dirty_vram() Jan Beulich
2026-04-27 9:30 ` Roger Pau Monné
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=ae8im__1Wrn420MH@macbook.local \
--to=roger.pau@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--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.