From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH] xen-blkback: use balloon pages for persistent grants
Date: Thu, 14 Feb 2013 21:52:17 -0500 [thread overview]
Message-ID: <20130215025217.GC10506@phenom.dumpdata.com> (raw)
In-Reply-To: <511CFC93.9070205@citrix.com>
On Thu, Feb 14, 2013 at 04:02:43PM +0100, Roger Pau Monné wrote:
> On 14/02/13 14:23, Konrad Rzeszutek Wilk wrote:
> > On Thu, Feb 14, 2013 at 11:12:09AM +0100, Roger Pau Monne wrote:
> >> With current persistent grants implementation we are not freeing the
> >> persistent grants after we disconnect the device. Since grant map
> >
> > Can you explain this in more details please? Isn't gnttab_set_unmap_op
> > in free_persistent_gnts doing the right job of putting in the right
> > mfn in? And then we could free the page?
>
> No, after gnttab_unmap_refs the page still points to the grant frame
> mfn. All the users of grant frames either have an internal buffer of
> pages that are reused (like blkback), or use balloon pages (like gntdev).
>
> I could probably modify gnttab_map to store the mfn and set it back at
> gnttab_unmap, but that will surely require more work than this simple fix.
Simple fix is what we want right now.
>
> >
> >
> >> operations change the mfn of the allocated page, and we can no longer
> >> pass it to __free_page without setting the mfn to a sane value, use
> >> balloon grant pages instead, as the gntdev device does.
> >
> >
> > Wow. I did not realize that we leaving such a huge memory leak behind!
> > But I guess that was never an issue as we would recycle those persistent
> > grants to other domains.
>
> No, we didn't recycle them AFAIK, we allocated them using alloc_page,
> passed them to gnttab_map, used them, and when closing the backend we
> only unmapped them, but they where never freed.
Ghastly!
prev parent reply other threads:[~2013-02-15 2:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-14 10:12 [PATCH] xen-blkback: use balloon pages for persistent grants Roger Pau Monne
2013-02-14 10:56 ` Roger Pau Monné
2013-02-14 13:23 ` Konrad Rzeszutek Wilk
2013-02-14 15:02 ` Roger Pau Monné
2013-02-15 2:52 ` Konrad Rzeszutek Wilk [this message]
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=20130215025217.GC10506@phenom.dumpdata.com \
--to=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=roger.pau@citrix.com \
--cc=xen-devel@lists.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