From: Tim Deegan Subject: Re: [PATCH, RFC] x86/HVM: batch vCPU wakeups Date: Wed, 10 Sep 2014 12:29:24 +0200 Message-ID: <20140910102924.GA44982@deinos.phlegethon.org> References: <540ED7810200007800032678@mail.emea.novell.com> <20140909212925.GC82414@deinos.phlegethon.org> <540F8123.7060000@citrix.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 1XRf9f-000561-9b for xen-devel@lists.xenproject.org; Wed, 10 Sep 2014 10:29:39 +0000 Content-Disposition: inline In-Reply-To: <540F8123.7060000@citrix.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: Andrew Cooper Cc: Ian Campbell , xen-devel , Keir Fraser , Ian Jackson , Jan Beulich List-Id: xen-devel@lists.xenproject.org At 23:37 +0100 on 09 Sep (1410302243), Andrew Cooper wrote: > >> +void cpu_raise_softirq_batch_finish(void) > >> +{ > >> + unsigned int cpu, this_cpu = smp_processor_id(); > >> + cpumask_t *mask = &per_cpu(batch_mask, this_cpu); > > Again, this_cpu()? > > ...But disagree here. Multiple uses of this_cpu($FOO) cannot be > coalesced due to RELOC_HIDE() deliberately preventing optimisation. For > multiple uses, pulling it out by pointer to start with results in rather > more efficient code. I wasn't questioning the pointer, but to the use of per_cpu(..., this_cpu) instead of this_cpu(...). Both of those involve a RELOC_HIDE(). Anyway, it's pretty clear from your and Jan's replies that multiple this_cpu() invocations are slower -- thanks for the clarification! Tim.