xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Tim Deegan <tim@xen.org>
To: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Cc: george.dunlap@eu.citrix.com, andres@gridcentric.ca,
	xen-devel@lists.xensource.com, keir.xen@gmail.com,
	adin@gridcentric.ca
Subject: Re: [PATCH 3 of 5] Rework locking in the PoD layer
Date: Thu, 2 Feb 2012 13:14:33 +0000	[thread overview]
Message-ID: <20120202131433.GM48883@ocelot.phlegethon.org> (raw)
In-Reply-To: <56ceab0118cba85cdcd3.1328126167@xdev.gridcentric.ca>

At 14:56 -0500 on 01 Feb (1328108167), Andres Lagar-Cavilla wrote:
>  xen/arch/x86/mm/mm-locks.h |   10 ++++
>  xen/arch/x86/mm/p2m-pod.c  |  112 ++++++++++++++++++++++++++------------------
>  xen/arch/x86/mm/p2m-pt.c   |    1 +
>  xen/arch/x86/mm/p2m.c      |    8 ++-
>  xen/include/asm-x86/p2m.h  |   27 +++-------
>  5 files changed, 93 insertions(+), 65 deletions(-)
> 
> 
> The PoD layer has a comples locking discipline. It relies on the
> p2m being globally locked, and it also relies on the page alloc
> lock to protect some of its data structures. Replace this all by an
> explicit pod lock: per p2m, order enforced.
> 
> Three consequences:
>     - Critical sections in the pod code protected by the page alloc
>       lock are now reduced to modifications of the domain page list.
>     - When the p2m lock becomes fine-grained, there are no
>       assumptions broken in the PoD layer.
>     - The locking is easier to understand.
> 
> Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>

This needs an Ack from George, too.  Also:

> @@ -922,6 +929,12 @@ p2m_pod_emergency_sweep(struct p2m_domai
>      limit = (start > POD_SWEEP_LIMIT) ? (start - POD_SWEEP_LIMIT) : 0;
>  
>      /* FIXME: Figure out how to avoid superpages */
> +    /* NOTE: Promote to globally locking the p2m. This will get complicated
> +     * in a fine-grained scenario. Even if we're to lock each gfn 
> +     * individually we must be careful about recursion limits and 
> +     * POD_SWEEP_STRIDE. This is why we don't enforce deadlock constraints 
> +     * between p2m and pod locks */
> +    p2m_lock(p2m);

That's a scary comment.  It looks to me as if the mm-locks.h mechanism
_does_ enforce those constraints - am I missing something?

Cheers,

Tim.

  reply	other threads:[~2012-02-02 13:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-01 19:56 [PATCH 0 of 5] Synchronized p2m lookups Andres Lagar-Cavilla
2012-02-01 19:56 ` [PATCH 1 of 5] Make p2m lookups fully synchronized wrt modifications Andres Lagar-Cavilla
2012-02-02 13:08   ` Tim Deegan
2012-02-02 14:01     ` Andres Lagar-Cavilla
2012-02-01 19:56 ` [PATCH 2 of 5] Clean up locking now that p2m lockups are fully synchronized Andres Lagar-Cavilla
2012-02-02 13:10   ` Tim Deegan
2012-02-02 14:31   ` George Dunlap
2012-02-02 19:40     ` Andres Lagar-Cavilla
2012-02-01 19:56 ` [PATCH 3 of 5] Rework locking in the PoD layer Andres Lagar-Cavilla
2012-02-02 13:14   ` Tim Deegan [this message]
2012-02-02 14:04     ` Andres Lagar-Cavilla
2012-02-02 15:33   ` George Dunlap
2012-02-02 20:03     ` Andres Lagar-Cavilla
2012-02-01 19:56 ` [PATCH 4 of 5] Re-order calls to put_gfn() around wait queu invocations Andres Lagar-Cavilla
2012-02-02 13:26   ` Tim Deegan
2012-02-01 19:56 ` [PATCH 5 of 5] x86/mm: Revert changeset 24582:f6c33cfe7333 Andres Lagar-Cavilla
2012-02-02 13:27   ` Tim Deegan

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=20120202131433.GM48883@ocelot.phlegethon.org \
    --to=tim@xen.org \
    --cc=adin@gridcentric.ca \
    --cc=andres@gridcentric.ca \
    --cc=andres@lagarcavilla.org \
    --cc=george.dunlap@eu.citrix.com \
    --cc=keir.xen@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).