From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCHv4 5/8] xen: use ticket locks for spin locks Date: Tue, 5 May 2015 14:56:07 +0100 Message-ID: <1430834167.2660.102.camel@citrix.com> References: <1430408002-30666-1-git-send-email-david.vrabel@citrix.com> <1430408002-30666-6-git-send-email-david.vrabel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YpdKg-0000nn-SX for xen-devel@lists.xenproject.org; Tue, 05 May 2015 13:56:22 +0000 In-Reply-To: <1430408002-30666-6-git-send-email-david.vrabel@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: David Vrabel Cc: Keir Fraser , Tim Deegan , Jennifer Herbert , Jan Beulich , Andrew Cooper , xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org 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.