[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] netfront leaking two pages on unload?


  • To: Andy Grover <andy.grover@xxxxxxxxxx>
  • From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
  • Date: Fri, 18 Jan 2008 21:26:39 +0000
  • Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 18 Jan 2008 13:27:18 -0800
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: AchaGM+tDfeAQcYMEdyX+wAWy6hiGQ==
  • Thread-topic: [Xen-devel] netfront leaking two pages on unload?

On 18/1/08 20:35, "Andy Grover" <andy.grover@xxxxxxxxxx> wrote:

> Thanks for taking a look.
> 
> I was going to put together a patch to properly free the 2 pages in
> netfront, but it looks like this is already handled inside
> gnttab_end_foreign_access().
> 
> It seems a little non-intuitive that gnttab_end_foreign_access doesn't
> just end foreign access, it frees the page too. This leads to what
> confused me -- a driver allocating a page but (seemingly) never freeing
> it.
> 
> I think it might be clearer to make callers explicitly free the page
> after checking gnttab_end_foreign_access's return val for success. Would
> you accept a patch doing this, or are there other reasons for the
> current code?

If the grant is not yet unmapped by the backend then the gnttab subsystem in
the frontend OS should take responsibility for freeing the page at the
appropriate time in the future (i.e., when the grant does become unmapped).
We don't want to leave that to the frontend driver itself because it would
result in code duplication in every driver, and also the driver may be
unloaded before the page can be freed.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.