From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH] linux_gntshr_munmap: munmap takes a length, not a page count Date: Wed, 3 Sep 2014 15:38:59 +0100 Message-ID: <54072803.1070304@citrix.com> References: <1409573807-15801-1-git-send-email-dave.scott@citrix.com> <1409752879.23789.29.camel@kazak.uk.xensource.com> <54072295.2000407@citrix.com> <1409753864.3323.2.camel@kazak.uk.xensource.com> <540723D8.2040709@citrix.com> <1409754702.3323.9.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XPBiK-0001QF-07 for xen-devel@lists.xenproject.org; Wed, 03 Sep 2014 14:39:12 +0000 In-Reply-To: <1409754702.3323.9.camel@kazak.uk.xensource.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: Ian Campbell , David Vrabel Cc: xen-devel@lists.xenproject.org, David Scott , ian.jackson@eu.citrix.com, stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org On 03/09/14 15:31, Ian Campbell wrote: > On Wed, 2014-09-03 at 15:21 +0100, David Vrabel wrote: >> On 03/09/14 15:17, Ian Campbell wrote: >>> On Wed, 2014-09-03 at 15:15 +0100, David Vrabel wrote: >>>> On 03/09/14 15:01, Ian Campbell wrote: >>>>> On Mon, 2014-09-01 at 13:16 +0100, David Scott wrote: >>>>>> This fixes a bug where if a client shares more than 1 page, the >>>>>> munmap call fails to clean up everything. A process which does >>>>>> a lot of sharing and unsharing can run out of resources. >>>>> The doc comment on xc_gntshr_munmap does say count is in pages, so your >>>>> change is correct but all of the in tree callers seem to pass a number >>>>> of bytes not a number of pages. i.e. everything in tools/libvchan passes >>>>> n*PAGE_SIZE. >>>>> >>>>> So I don't think this change is complete without also updating those. >>>> Would the corrent non-ABI/API-breaking fix be to just update the >>>> documentation? >>> libxc doesn't have a stable API or ABI. >> xc_gntshr_*() really should be part of a separate libxc-for-domu that >> does have a stable ABI. > This hadn't occurred to me, but yes, this does sound sensible. Currently, all domU event and grant operations require libxc, including the use of libxenstore. I have raised this before, and believe there is a line item defered until 4.6 to cleave libxc into several pieces, to avoid needing to put libxc into all domUs to use the xenstore-* binaries. libxenevent and libxengrant seem like plausible library names. ~Andrew