From: Keir Fraser Subject: Re: alloc_heap_pages is low efficient with more CPUs Date: Sat, 13 Oct 2012 09:59:45 +0100 Message-ID: References: <2012101315200385948426@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <2012101315200385948426@gmail.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: tupeng212 Cc: xen-devel List-Id: xen-devel@lists.xenproject.org On 13/10/2012 08:20, "tupeng212" wrote: > /* Allocate 2^@order contiguous pages. */ > static struct page_info *alloc_heap_pages( > unsigned int zone_lo, unsigned int zone_hi, > unsigned int node, unsigned int order, unsigned int memflags) > { > cpus_clear(mask); > for ( i = 0; i < (1 << order); i++ ) > { > if ( pg[i].u.free.need_tlbflush ) > { > /* Add in extra CPUs that need flushing because of this page. */ > cpus_andnot(extra_cpus_mask, cpu_online_map, mask); > tlbflush_filter(extra_cpus_mask, pg[i].tlbflush_timestamp); > cpus_or(mask, mask, extra_cpus_mask); > } > } > if ( unlikely(!cpus_empty(mask)) ) > { > perfc_incr(need_flush_tlb_flush); > flush_tlb_mask(&mask); > } > return pg; > } > > Is this equal to : in pg[1< mask=0, then flush TLB mask ? No! -- Keir