From: "Jan Beulich" Subject: Re: [PATCHv7 3/3] gnttab: use per-VCPU maptrack free lists Date: Tue, 12 May 2015 13:56:13 +0100 Message-ID: <5552148D0200007800079762@mail.emea.novell.com> References: <1430400525-31064-1-git-send-email-david.vrabel@citrix.com> <1430400525-31064-4-git-send-email-david.vrabel@citrix.com> <5548D4F60200007800076AA9@mail.emea.novell.com> <5551DD79.40507@citrix.com> <5552022902000078000796A4@mail.emea.novell.com> <5551F3F8.7070602@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Ys9jM-0003o7-NO for xen-devel@lists.xenproject.org; Tue, 12 May 2015 12:56:16 +0000 In-Reply-To: <5551F3F8.7070602@citrix.com> Content-Disposition: inline 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: Keir Fraser , IanCampbell , Christoph Egger , Tim Deegan , Matt Wilson , xen-devel@lists.xenproject.org, Malcolm Crossley List-Id: xen-devel@lists.xenproject.org >>> On 12.05.15 at 14:37, wrote: > On 12/05/15 12:37, Jan Beulich wrote: >>>>> On 12.05.15 at 13:01, wrote: >>> On 05/05/15 13:34, Jan Beulich wrote: >>>>>>> On 30.04.15 at 15:28, wrote: >>>>> @@ -1430,6 +1456,17 @@ gnttab_setup_table( >>>>> gt = d->grant_table; >>>>> write_lock(>->lock); >>>>> >>>>> + /* Tracking of mapped foreign frames table */ >>>>> + if ( (gt->maptrack = xzalloc_array(struct grant_mapping *, >>>>> + max_maptrack_frames * d->max_vcpus)) == NULL ) >>>>> + goto out3; >>>> >>>> This surely can easily become an allocation of far more than a page, >>>> and hence needs to be broken up (perhaps using vmap() to map >>>> individually allocated pages). >>> >>> I think there should be a common vzalloc_array() function. Do you >>> agree? This will use xzalloc_array() if the alloc is < PAGE_SIZE to >>> avoid needlessly using vmap space. >> >> For the _array flavor I'm not sure, but vmalloc()/vzalloc() are >> already in the process of being added. > > Can I leave this as-is (with the xzalloc_array()) and fix it up once > vzalloc() exists? Sure. Jan