From: "Jan Beulich" Subject: [PATCH 1/3] spinlock: use local_irq_disable() instead of local_irq_save() where possible Date: Thu, 08 Jan 2015 16:13:03 +0000 Message-ID: <54AEBA9F0200007800052C91@mail.emea.novell.com> References: <54AEB7C70200007800052C4D@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartA194569F.1__=" Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Y9Fhv-0006Xx-Qd for xen-devel@lists.xenproject.org; Thu, 08 Jan 2015 16:13:11 +0000 In-Reply-To: <54AEB7C70200007800052C4D@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: xen-devel Cc: Ian Campbell , Keir Fraser , Ian Jackson , Tim Deegan List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__PartA194569F.1__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline ... as generally being a cheaper operation. Signed-off-by: Jan Beulich --- a/xen/common/spinlock.c +++ b/xen/common/spinlock.c @@ -162,7 +162,7 @@ unsigned long _spin_lock_irqsave(spinloc local_irq_restore(flags); while ( likely(_raw_spin_is_locked(&lock->raw)) ) cpu_relax(); - local_irq_save(flags); + local_irq_disable(); } LOCK_PROFILE_GOT; preempt_disable(); @@ -313,7 +313,7 @@ unsigned long _read_lock_irqsave(rwlock_ local_irq_restore(flags); while ( (x =3D lock->lock) & RW_WRITE_FLAG ) cpu_relax(); - local_irq_save(flags); + local_irq_disable(); } } while ( cmpxchg(&lock->lock, x, x+1) !=3D x ); preempt_disable(); @@ -409,7 +409,7 @@ unsigned long _write_lock_irqsave(rwlock local_irq_restore(flags); while ( (x =3D lock->lock) & RW_WRITE_FLAG ) cpu_relax(); - local_irq_save(flags); + local_irq_disable(); } } while ( cmpxchg(&lock->lock, x, x|RW_WRITE_FLAG) !=3D x ); while ( x !=3D 0 ) --=__PartA194569F.1__= Content-Type: text/plain; name="spinlock-use-irqenable.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="spinlock-use-irqenable.patch" spinlock: use local_irq_disable() instead of local_irq_save() where = possible=0A=0A... as generally being a cheaper operation.=0A=0ASigned-off-b= y: Jan Beulich =0A=0A--- a/xen/common/spinlock.c=0A+++ = b/xen/common/spinlock.c=0A@@ -162,7 +162,7 @@ unsigned long _spin_lock_irqs= ave(spinloc=0A local_irq_restore(flags);=0A while ( = likely(_raw_spin_is_locked(&lock->raw)) )=0A cpu_relax();=0A- = local_irq_save(flags);=0A+ local_irq_disable();=0A }=0A = LOCK_PROFILE_GOT;=0A preempt_disable();=0A@@ -313,7 +313,7 @@ = unsigned long _read_lock_irqsave(rwlock_=0A local_irq_restore(f= lags);=0A while ( (x =3D lock->lock) & RW_WRITE_FLAG )=0A = cpu_relax();=0A- local_irq_save(flags);=0A+ = local_irq_disable();=0A }=0A } while ( cmpxchg(&lock->lock, = x, x+1) !=3D x );=0A preempt_disable();=0A@@ -409,7 +409,7 @@ unsigned = long _write_lock_irqsave(rwlock=0A local_irq_restore(flags);=0A= while ( (x =3D lock->lock) & RW_WRITE_FLAG )=0A = cpu_relax();=0A- local_irq_save(flags);=0A+ = local_irq_disable();=0A }=0A } while ( cmpxchg(&lock->lock, x, = x|RW_WRITE_FLAG) !=3D x );=0A while ( x !=3D 0 )=0A --=__PartA194569F.1__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__PartA194569F.1__=--