From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH v2] x86/PoD: shorten certain operations on higher order ranges Date: Tue, 29 Sep 2015 13:20:40 +0100 Message-ID: <560A8218.90405@citrix.com> References: <56096B3902000078000A63BE@prv-mh.provo.novell.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 1Zgttk-0008Ke-9W for xen-devel@lists.xenproject.org; Tue, 29 Sep 2015 12:20:44 +0000 In-Reply-To: <56096B3902000078000A63BE@prv-mh.provo.novell.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: Jan Beulich , xen-devel Cc: George Dunlap , Keir Fraser List-Id: xen-devel@lists.xenproject.org On 28/09/15 15:30, Jan Beulich wrote: > Now that p2m->get_entry() always returns a valid order, utilize this > to accelerate some of the operations in PoD code. (There are two uses > of p2m->get_entry() left which don't easily lend themselves to this > optimization.) > > Also adjust a few types as needed and remove stale comments from > p2m_pod_cache_add() (to avoid duplicating them yet another time). > > Signed-off-by: Jan Beulich > --- > v2: Add a code comment in p2m_pod_decrease_reservation(). > > --- a/xen/arch/x86/mm/p2m-pod.c > +++ b/xen/arch/x86/mm/p2m-pod.c > @@ -119,20 +119,23 @@ p2m_pod_cache_add(struct p2m_domain *p2m > > unlock_page_alloc(p2m); > > - /* Then add the first one to the appropriate populate-on-demand list */ > - switch(order) > + /* Then add to the appropriate populate-on-demand list. */ > + switch ( order ) > { > + case PAGE_ORDER_1G: > + for ( i = 0; i < (1UL << PAGE_ORDER_1G); i += 1UL << PAGE_ORDER_2M ) > + page_list_add_tail(page + i, &p2m->pod.super); > + break; > case PAGE_ORDER_2M: > - page_list_add_tail(page, &p2m->pod.super); /* lock: page_alloc */ > - p2m->pod.count += 1 << order; > + page_list_add_tail(page, &p2m->pod.super); > break; > case PAGE_ORDER_4K: > - page_list_add_tail(page, &p2m->pod.single); /* lock: page_alloc */ > - p2m->pod.count += 1; > + page_list_add_tail(page, &p2m->pod.single); > break; > default: > BUG(); > } > + p2m->pod.count += 1 << order; 1UL Otherwise, Reviewed-by: Andrew Cooper