From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: Re: [PATCHv4 5/8] xen: use ticket locks for spin locks Date: Mon, 11 May 2015 14:13:49 +0100 Message-ID: <5550AB0D.8050809@citrix.com> References: <1430408002-30666-1-git-send-email-david.vrabel@citrix.com> <1430408002-30666-6-git-send-email-david.vrabel@citrix.com> <554C9FB60200007800078181@mail.emea.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 1YrnWu-0005mb-VQ for xen-devel@lists.xenproject.org; Mon, 11 May 2015 13:13:57 +0000 In-Reply-To: <554C9FB60200007800078181@mail.emea.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 , David Vrabel Cc: Keir Fraser , Ian Campbell , Andrew Cooper , Jennifer Herbert , Tim Deegan , xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org On 08/05/15 10:36, Jan Beulich wrote: >> >> + } >> + } >> smp_mb(); >> } > > The old code had smp_mb() before _and_ after the check - is it really > correct to drop the one before (or effectively replace it by smp_rmb() > in observe_{lock,head}())? Typical usage is: d->is_dying = DOMDYING_dying; spin_barrier(&d->domain_lock); So there needs to be a barrier before we check that the lock is released. i.e., I removed the wrong smp_mb(). I don't see the need for the second barrier since there's no stores in _spin_barrier() and observe_lock() and observe_head() both have their required read barriers. David