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: Mon, 10 Jan 2011 17:24:14 -0500 Message-ID: <20110110222414.GF15016@dumpdata.com> References: <1292545063-32107-1-git-send-email-dgdegra@tycho.nsa.gov> <1292545063-32107-6-git-send-email-dgdegra@tycho.nsa.gov> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1292545063-32107-6-git-send-email-dgdegra@tycho.nsa.gov> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Daniel De Graaf Cc: jeremy@goop.org, xen-devel@lists.xensource.com, Ian.Campbell@citrix.com List-Id: xen-devel@lists.xenproject.org > -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? > kfree(map); > } > > @@ -310,6 +305,7 @@ static void gntdev_vma_close(struct vm_area_struct *vma) > map->is_mapped = 0; > map->vma = NULL; > vma->vm_private_data = NULL; > + gntdev_put_map(map); I am somehow not seeing this function, nor the use_ptemod defined. Ah, you answered that later on..