All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: xen-devel@lists.xenproject.org, Tim Deegan <tim@xen.org>,
	ian.jackson@eu.citrix.com,
	Stefano Stabellini <stefano.stabellini@citrix.com>,
	patches@linaro.org
Subject: Re: [PATCH v6 08/10] xen/arm: Add relinquish_p2m_mapping to remove reference on every mapped page
Date: Wed, 18 Dec 2013 14:06:18 +0000	[thread overview]
Message-ID: <52B1ABDA.1050503@linaro.org> (raw)
In-Reply-To: <1387372866.28680.14.camel@kazak.uk.xensource.com>



On 12/18/2013 01:21 PM, Ian Campbell wrote:
> (the cc line here is a bit odd, why Ian J? But not Tim or Stefano? I've
> added those two) On Tue, 2013-12-17 at 17:02 +0000, Ian Campbell wrote:
>>> For the last item, I think it's a bit stupid to create table if we are
>>> removing/relinquish mapping. But I think it's an improvement for later.
>>> There are lots of improvement to do in this function (eg: flushing).
>>
>> Agreed.
>
> Actually, there is an efficiency concern here.
>
> If we were to skip non-present first and second levels then we would
> skip vast swathes of the address space very quickly. As it stands we
> actively spend time filling it in just so we can recurse over it.
>
> This effectively turns this back into a loop over the entire gfn space,
> which is what we wanted to avoid.
>
> The use of next_gfn_to_relinquish..max_mapped_gfn mitigates this
> somewhat, but max_mapped_gfn is guest controlled and can trivially be
> made huge by the guest.
>
> How hard would it be to skip missing entries for remove and relinquish
> walks? Should just be roughtly:
>
>    int populate = (op == INSERT || op == ALLOCATE)
>
>    for ( addr = ... ; addr < ... ; addr ... )
>    {
>      [...]
>
>      if ( !first[...].valid )
>      {
>         if ( !populate ) {
> 	 addr += skip size of a first supermapping,
>           continue;
>         }
>         rc = p2m_create(...)
>         [..error..]
>
>         [same for second etc]
>      }
>    }
>
> "size of a first" needs care vs the += PAGE_SIZE in the for loop, I'd be
> inclined to turn this into a while loop and move the += PAGE_SIZE to the
> end.
>
> Ian.
>

Ian, is it fine for you if I send a patch on top of this patch series? 
So we can go ahead with the current series.

-- 
Julien Grall

  parent reply	other threads:[~2013-12-18 14:06 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-17 16:27 [PATCH v6 00/10] xen/arm: Handle correctly foreign mapping Julien Grall
2013-12-17 16:27 ` [PATCH v6 01/10] xen/arm: Introduce steps in domain_relinquish_resource Julien Grall
2013-12-17 16:27 ` [PATCH v6 02/10] xen/arm: move mfn_to_p2m_entry in arch/arm/p2m.c Julien Grall
2013-12-17 16:27 ` [PATCH v6 03/10] xen/arm: Implement p2m_type_t as an enum Julien Grall
2013-12-17 16:27 ` [PATCH v6 04/10] xen/arm: Store p2m type in each page of the guest Julien Grall
2013-12-18 14:18   ` Ian Campbell
2013-12-17 16:27 ` [PATCH v6 05/10] xen/arm: p2m: Extend p2m_lookup parameters to retrieve the p2m type Julien Grall
2013-12-17 16:27 ` [PATCH v6 06/10] xen/arm: Retrieve p2m type in get_page_from_gfn Julien Grall
2013-12-17 16:27 ` [PATCH v6 07/10] xen/arm: Handle remove foreign mapping Julien Grall
2013-12-17 16:27 ` [PATCH v6 08/10] xen/arm: Add relinquish_p2m_mapping to remove reference on every mapped page Julien Grall
2013-12-17 16:36   ` Ian Campbell
2013-12-17 16:58     ` Julien Grall
2013-12-17 17:02       ` Ian Campbell
2013-12-18 13:21         ` Ian Campbell
2013-12-18 13:30           ` Julien Grall
2013-12-18 14:06           ` Julien Grall [this message]
2013-12-18 14:12             ` Ian Campbell
2013-12-18 14:20   ` Ian Campbell
2013-12-18 16:48   ` Julien Grall
2013-12-18 16:50     ` Ian Campbell
2013-12-17 16:27 ` [PATCH v6 09/10] xen/arm: Set foreign page type to p2m_map_foreign Julien Grall
2013-12-17 16:27 ` [PATCH v6 10/10] xen/arm: grant-table: Support read-only mapping Julien Grall
2013-12-18 14:41 ` [PATCH v6 00/10] xen/arm: Handle correctly foreign mapping Ian Campbell

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=52B1ABDA.1050503@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=Ian.Campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=patches@linaro.org \
    --cc=stefano.stabellini@citrix.com \
    --cc=tim@xen.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.