From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: Linux grant map/unmap improvement proposal (Draft B) Date: Tue, 14 Oct 2014 11:27:36 +0100 Message-ID: <1413282456.10417.27.camel@citrix.com> References: <543BD686.3080006@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <543BD686.3080006@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: David Vrabel Cc: "Xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Mon, 2014-10-13 at 14:41 +0100, David Vrabel wrote: > Safe grant unmap > ---------------- > > Grant references will only be unmapped when they are no longer in use. > i.e., the page reference count is one. > > int gnttab_unmap_refs_async(struct gnttab_unmap_grant_ref *unmap_ops, > struct gnttab_unmap_grant_ref *kunmap_ops, > struct page **pages, unsigned int count, > void (*done)(void *data), void *data); > > The `gnttab_unmap_refs_async()` function will unmap the grant > references using the supplied unmap operations and call `done(data)`. > The grant unmap will only be done once all pages are no longer in use. > > It shall run synchronously on the first attempt (this is expected to > be the most common case). If any page is in use, it shall queue the > unmap request to be tried at a later time. > > Only the blkback and gntdev devices need to use asynchronouse unmaps. What about storage over networking? Does this work for that case too? I suppose that would just manifest as >1 reference counts when the blk op finishes, which would be taken care of by the delay. Ian.