From: Keir Fraser Subject: Re: [SPAM] Re: A patch to xen/arch/x86/hvm/pmtimer.c for both Xen 4.0.0 and Xen 4.0.1 to improve HVM scalability Date: Tue, 16 Nov 2010 08:08:41 +0000 Message-ID: References: <4CE246DB0200007800022704@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4CE246DB0200007800022704@vpn.id2.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jan Beulich Cc: Song Xiang , xen-devel@lists.xensource.com, Haibo Chen List-Id: xen-devel@lists.xenproject.org On 16/11/2010 07:54, "Jan Beulich" wrote: >> No need for your new field at all! It initially seems weird that this >> performs much better than the original code, but I guess it might: if all >> VCPUs are piling in here at the same time, rather than having to execute one >> by one, we'll have one go first and then the others will all execute >> simultaneously read-only in convoy... > > They'd need to re-measure whether this still provides a meaningful > benefit, I think. Definitely. I explicitly asked for that. Oh, also the approach is currently buggy. Although s->pm.tmr_val is atomic to read, it is not atomically updated in pmt_update_time(). Need to calculate new value for tmr_val in a local variable then update the shared field with an atomic_set()-alike *(volatile u32 *)&s->pm.tmr_val = x type of arrangement. For all this extra fragility, the perf win needs to be compelling. -- Keir