xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: george.dunlap@eu.citrix.com, Xen-devel@lists.xensource.com,
	tim@xen.org, keir.xen@gmail.com, JBeulich@suse.com
Subject: Re: [V5 PATCH 6/7] pvh dom0: Add and remove foreign pages
Date: Fri, 6 Dec 2013 18:07:07 -0800	[thread overview]
Message-ID: <20131206180707.219ff6bd@mantra.us.oracle.com> (raw)
In-Reply-To: <1386325112.6672.15.camel@kazak.uk.xensource.com>

On Fri, 6 Dec 2013 10:18:32 +0000
Ian Campbell <Ian.Campbell@citrix.com> wrote:

> On Thu, 2013-12-05 at 17:32 -0800, Mukesh Rathor wrote:
> > > > Why is page NULL in this case? I'd have thought that
> > > > get_page_from_gfn could handle the p2m_foreign case internally
> > > > and still return the page, with the ref count taken too.
> > > > 
> > > > Doing that would cause a lot of the magic, and in particular the
> > > > ifdef, in the following code to disappear.
> > > 
> > > I had brought this up earlier this year (that's how old this patch
> > > is). get_page_from_gfn can't be used because the mfn owner is
> > > foreign domain and not domain "d", and get_page() will barf.
> > 
> > Rephrase: get_page_from_gfn can't be changed to handle p2m_foreign
> > because...
> 
> Even with that my original reply stands. In the case of a p2m_foreign
> get_page_from_gfn shouldn't be calling get_page, but should be doing
> the same dance as you are currently doing in this function to get at
> the page's original owner and take whatever ref is needed etc etc
> instead.

Wish we were having this discussion 8 months ago when I brought
this up:

http://lists.xen.org/archives/html/xen-devel/2013-04/msg00492.html


Anyways, one of the issues doing what you say is get_page_from_gfn() 
refcnts the page, where as in my path I'm not refcounting since the 
domain is already holding one from xenmem_add_foreign_to_p2m(). It 
would be confusing for it to be doing different things for different
types. So, it should refcnt foreign also, and that would mean a direct
call to page_get_owner_and_reference() in get_page_from_gfn_p2m. However,
the "if ( p2m_is_foreign()) put_page()" will still have to be done
in the "case XENMEM_remove_from_physmap" caller path.

In any case, IMO, any changes around get_page* are too intrusive at 
this point, and we should come back to it start of 4.5.

I made the code symmetrical like you said in different thread, take
a look at my patch in the V6 thread. I think you'll find that acceptable.

thanks
mukesh

  reply	other threads:[~2013-12-07  2:07 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-05  2:05 [V5 PATCH 0/7]: PVH dom0 Mukesh Rathor
2013-12-05  2:05 ` [V5 PATCH 1/7] pvh dom0: move some pv specific code to static functions Mukesh Rathor
2013-12-05  2:05 ` [V5 PATCH 2/7] pvh dom0: construct_dom0 changes Mukesh Rathor
2013-12-05  2:05 ` [V5 PATCH 3/7] pvh dom0: implement XENMEM_add_to_physmap_range for x86 Mukesh Rathor
2013-12-05  2:05 ` [V5 PATCH 4/7] pvh dom0: Introduce p2m_map_foreign Mukesh Rathor
2013-12-05  2:05 ` [V5 PATCH 5/7] pvh: change xsm_add_to_physmap Mukesh Rathor
2013-12-05  2:05 ` [V5 PATCH 6/7] pvh dom0: Add and remove foreign pages Mukesh Rathor
2013-12-05 12:00   ` Ian Campbell
2013-12-06  1:15     ` Mukesh Rathor
2013-12-06  1:32       ` Mukesh Rathor
2013-12-06 10:18         ` Ian Campbell
2013-12-07  2:07           ` Mukesh Rathor [this message]
2013-12-06 10:15       ` Ian Campbell
2013-12-05 12:47   ` Julien Grall
2013-12-06  1:39     ` Mukesh Rathor
2013-12-05 13:12   ` Julien Grall
2013-12-06  1:57     ` Mukesh Rathor
2013-12-06  2:40       ` Mukesh Rathor
2013-12-05  2:05 ` [V5 PATCH 7/7] pvh dom0: add opt_dom0pvh to setup.c Mukesh Rathor

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=20131206180707.219ff6bd@mantra.us.oracle.com \
    --to=mukesh.rathor@oracle.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=Xen-devel@lists.xensource.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=keir.xen@gmail.com \
    --cc=tim@xen.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 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).