From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH 5/7] xen-gntdev: Add reference counting to maps Date: Tue, 11 Jan 2011 12:46:13 -0500 Message-ID: <20110111174613.GF14017@dumpdata.com> References: <1292545063-32107-1-git-send-email-dgdegra@tycho.nsa.gov> <1292545063-32107-6-git-send-email-dgdegra@tycho.nsa.gov> <20110110222414.GF15016@dumpdata.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Stefano Stabellini Cc: Ian Campbell , Daniel De Graaf , "xen-devel@lists.xensource.com" , "jeremy@goop.org" List-Id: xen-devel@lists.xenproject.org On Tue, Jan 11, 2011 at 11:10:23AM +0000, Stefano Stabellini wrote: > On Mon, 10 Jan 2011, Konrad Rzeszutek Wilk wrote: > > > -static void gntdev_free_map(struct grant_map *map) > > > -{ > > > - unsigned i; > > > + atomic_sub(map->count, &pages_mapped); > > > > > > - if (!map) > > > - return; > > > + if (!use_ptemod) > > > + unmap_grant_pages(map, 0, map->count); > > > > > > for (i = 0; i < map->count; i++) { > > > if (map->pages[i]) > > > __free_page(map->pages[i]); > > > } > > > + kfree(map->pages); > > > > Can you roll that in the previous patch that introduced the map->pages code? > > > > map->pages is actually introduced by "xen gntdev: use gnttab_map_refs > and gnttab_unmap_refs" in my patch series and it already has a Right. But I meant his patch that collapsed all of the different kzalloc's in just one. > kfree(map->pages) in gntdev_free_map. > In fact I think reading this chuck of the patch on its own is misleading > because as you can see the whole gntdev_free_map function has been > removed...