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: Tue, 5 May 2015 14:58:05 +0100 Message-ID: <5548CC6D.1040708@citrix.com> References: <1430408002-30666-1-git-send-email-david.vrabel@citrix.com> <1430408002-30666-6-git-send-email-david.vrabel@citrix.com> <1430834167.2660.102.camel@citrix.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 1YpdMS-00014U-AZ for xen-devel@lists.xenproject.org; Tue, 05 May 2015 13:58:12 +0000 In-Reply-To: <1430834167.2660.102.camel@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: Ian Campbell Cc: Keir Fraser , Tim Deegan , Jennifer Herbert , Jan Beulich , Andrew Cooper , xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org On 05/05/15 14:56, Ian Campbell wrote: > On Thu, 2015-04-30 at 16:33 +0100, David Vrabel wrote: >> >> void _spin_lock_irq(spinlock_t *lock) >> { >> - LOCK_PROFILE_VAR; >> - >> ASSERT(local_irq_is_enabled()); >> local_irq_disable(); >> - check_lock(&lock->debug); >> - while ( unlikely(!_raw_spin_trylock(&lock->raw)) ) >> - { >> - LOCK_PROFILE_BLOCK; >> - local_irq_enable(); >> - while ( likely(_raw_spin_is_locked(&lock->raw)) ) >> - cpu_relax(); >> - local_irq_disable(); >> - } >> - LOCK_PROFILE_GOT; >> - preempt_disable(); >> + _spin_lock(lock); > > This (and the irqsave variant) differs in that it spins/waits with irq's > disabled unlike the previous implementation which enabled irqs while it > waited. > > Is this change intentional? I think it warrants a mention and rationale > in the commit log if so. It's mentioned in the cover letter, but I'll add it to the commit description as well. David