From: Olaf Hering <olaf@aepfle.de>
To: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Cc: xen-devel@lists.xensource.com
Subject: Re: [PATCH 3 of 3] RFC: xenpaging: use waitqueue in ept_get
Date: Wed, 23 Nov 2011 17:37:28 +0100 [thread overview]
Message-ID: <20111123163728.GA6000@aepfle.de> (raw)
In-Reply-To: <b9f83375b8bf452e866311e3ec3fbbc0.squirrel@webmail.lagarcavilla.org>
On Tue, Nov 22, Andres Lagar-Cavilla wrote:
> Hi Olaf,
>
> thanks for posting these RFC patches, great work!
>
> I have several comments. Most importantly, I want to hash out the
> interactions between these wait queues and the work I've been doing on p2m
> synchronization. I've been runnning Xen with synchronized (i.e. locking)
> p2m lookups for a few weeks now with little/no trouble. You can refer to a
> patch I posted to the list previously, which I can resend. (I'm waiting on
> feedback on some previous patches I sent to keep pushing on this work)
>
> - I think the waitqueue should be part of struct arch_domain. It is an x86
> construct that applies only to the base level p2m of the domain, not every
> possible p2m in a nested setting.
Good point, I will move it. On the other hand, its current location cant
be the final solution. A wake_up would start all waiting vcpus, not just
the ones waiting for a certain gfn (in case of paging). There needs to
be a better way for selective wake_up.
> - The right place to wait is not ept->get_entry, imho, but rather the
> implementation-independent caller (get_gfn_type_access). More p2m
> implementations could be added in the future (however unlikely that may
> be) that can also perform paging.
The wait could probably be moved one level up, yes.
> - With locking p2m lookups, one needs to be careful about in_atomic. I
> haven't performed a full audit of all callers, but this is what I can say:
> 1. there are no code paths that perform recursive p2m lookups, *on
> different gfns*, with p2m_query_t != p2m_query
> 2. there are recursive lookups of different gfns, with p2m_query_t ==
> p2m_query, most notably pod sweeps. These do not represent a problem here,
> since those paths will skip over gfns that are paged.
>
> Why is this important? Because we need to be in a position where a code
> snippet such as
>
> get_gfn_type_access(gfn) {
> retry:
> p2m_lock()
> mfn = p2m->get_entry(gfn, &p2mt)
> if (p2mt == paging) {
> p2m_unlock()
> sleep_on_waitqueue()
> goto retry;
> }
>
> works. This will get us a non-racy p2m that sends vcpu's to sleep without
> holding locks. Makes sense?
Something like that can be done if needed, yes.
> - What is the plan for grant operations for pv-on-hvm drivers? Those will
> enter get_gfn* holding the domain lock, and thus in an atomic context.
Is that a new thing? So far my PVonHVM guests did not encounter that
issue. I see do_grant_table_op() taking the domain_lock, but is this
code path really entered from the guest or rather from dom0?
__get_paged_frame() returns GNTST_eagain, and that needs to be handled
by callers of do_grant_table_op. linux-2.6.18-xen.hg has code to retry
the grant operation in that case.
Olaf
next prev parent reply other threads:[~2011-11-23 16:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.1126.1321998852.12970.xen-devel@lists.xensource.com>
2011-11-23 4:52 ` [PATCH 3 of 3] RFC: xenpaging: use waitqueue in ept_get Andres Lagar-Cavilla
2011-11-23 16:37 ` Olaf Hering [this message]
2011-11-23 17:36 ` Andres Lagar-Cavilla
2011-11-23 4:58 ` RFC: mem_event: use wait queue when ring is full Andres Lagar-Cavilla
2011-11-23 16:49 ` Olaf Hering
2011-11-23 17:17 ` Keir Fraser
2011-11-23 18:23 ` Olaf Hering
2011-11-22 21:13 [PATCH 0 of 3] RFC: wait queue usage Olaf Hering
2011-11-22 21:13 ` [PATCH 3 of 3] RFC: xenpaging: use waitqueue in ept_get Olaf Hering
2011-11-23 8:54 ` 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=20111123163728.GA6000@aepfle.de \
--to=olaf@aepfle.de \
--cc=andres@lagarcavilla.org \
--cc=xen-devel@lists.xensource.com \
/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.