From: "Jan Beulich" Subject: Re: [PATCH v4 1/4] xen: introduce a helper to allocate non-contiguous memory Date: Thu, 07 May 2015 16:29:22 +0100 Message-ID: <554BA0F20200007800077BB5@mail.emea.novell.com> References: <1431008976-20414-1-git-send-email-roger.pau@citrix.com> <1431008976-20414-2-git-send-email-roger.pau@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 1YqNjo-0006y2-Fk for xen-devel@lists.xenproject.org; Thu, 07 May 2015 15:29:24 +0000 In-Reply-To: <1431008976-20414-2-git-send-email-roger.pau@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: Roger Pau Monne Cc: Andrew Cooper , Tim Deegan , Ian Campbell , xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org >>> On 07.05.15 at 16:29, wrote: > The allocator uses independent calls to alloc_heap_pages in order to get the > desired amount of memory and then maps all the independent physical > addresses into a contiguous virtual address space. > > In order to keep track of this regions a red-black tree is used. I don't think this is needed (and makes the code needlessly large) - reading the MFNs out of the page table entries during vfree() should be quite fine. Having named vfree() you may already guess that I'd also prefer these to be called vmalloc()/vfree(), the more that I can't see why they're being restricted to the Xen heap (rather than using anonymous domheap allocations). Jan