xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>, Tim Deegan <tim@xen.org>
Subject: Re: [RFC PATCH] PVH: cleanup of p2m upon p2m destroy
Date: Tue, 17 Dec 2013 17:01:16 -0800	[thread overview]
Message-ID: <20131217170116.5cb9d0db@mantra.us.oracle.com> (raw)
In-Reply-To: <52B01C88020000780010E042@nat28.tlf.novell.com>

On Tue, 17 Dec 2013 08:42:32 +0000
"Jan Beulich" <JBeulich@suse.com> wrote:

> >>> On 17.12.13 at 02:47, Mukesh Rathor <mukesh.rathor@oracle.com>
> >>> wrote:
> > When a controlling domain is destroyed, any p2m_is_foreign pages
> > must release the refcnt gotten when the page was added to the p2m.
> > 
> > Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
> 
> First of all, you leave open what the relationship of this is with
> your 7-patch v7 series. Why is this not part of it? Obviously any
> necessary cleanup would logically have to come no later than
> where the first creation of pages of this type happens...

I was intending this for 4.5, and the series for 4.4, but now i can
combine it since the series is out of 4.4.


> > +/* This function to do any cleanup while walking the entire p2m */
> > +int p2m_cleanup(struct domain *d)
> > +{
> > +    int rc = 0;
> > +    unsigned long gfn, count = 0;
> > +    struct p2m_domain *p2m = p2m_get_hostp2m(d);
> > +
> > +    if ( !is_pvh_domain(d) )
> > +        return 0;
> > +
> > +    for ( gfn = p2m->next_foreign_gfn_to_check;
> > +          gfn <= p2m->max_mapped_pfn; gfn++, count++ )
> > +    {
> > +        p2m_type_t p2mt;
> > +        mfn_t mfn = get_gfn_query(d, gfn, &p2mt);
> > +
> > +        if ( unlikely(p2m_is_foreign(p2mt)) )
> > +            put_page(mfn_to_page(mfn));
> > +        put_gfn(d, gfn);
> > +        
> > +        /* Preempt every 10k pages, arbritary */
> > +        if ( count == 10000 && hypercall_preempt_check() )
> > +        {
> > +            p2m->next_foreign_gfn_to_check = gfn + 1;
> > +            rc = -EAGAIN;
> > +            break;
> > +        }
> 
> So it looks like you copied one of the two obvious bugs from
> relinquish_shared_pages() _and_ deferred the preemption point

LOL...

> by quite a bit - 10,000 pages is quite a lot, the 512 used there
> seems much more reasonable.

Because the foreign pages are very small amount, so the loop is
mostly not doing anything. ok, will reduce it to 1k.

thanks
Mukesh

  parent reply	other threads:[~2013-12-18  1:01 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-17  1:47 [RFC PATCH] PVH: cleanup of p2m upon p2m destroy Mukesh Rathor
2013-12-17  8:42 ` Jan Beulich
2013-12-17 10:19   ` Tim Deegan
2013-12-18  2:44     ` Mukesh Rathor
2013-12-18 10:03       ` Jan Beulich
2013-12-18 11:32         ` Dietmar Hahn
2013-12-18 10:09       ` Tim Deegan
2013-12-18 16:51         ` Tim Deegan
2013-12-19  2:01           ` Mukesh Rathor
2013-12-19 10:50             ` Tim Deegan
2013-12-20  2:00               ` Mukesh Rathor
2013-12-20  9:22                 ` Tim Deegan
2014-02-01  2:38           ` Mukesh Rathor
2014-02-03 10:12             ` Tim Deegan
2013-12-20 13:58         ` George Dunlap
2013-12-20 14:29           ` Tim Deegan
2013-12-18  1:01   ` Mukesh Rathor [this message]
2013-12-18  8:12     ` 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=20131217170116.5cb9d0db@mantra.us.oracle.com \
    --to=mukesh.rathor@oracle.com \
    --cc=JBeulich@suse.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 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).