From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH 1/3] spinlock: use local_irq_disable() instead of local_irq_save() where possible Date: Fri, 9 Jan 2015 11:27:45 -0500 Message-ID: <20150109162745.GI2726@l.oracle.com> References: <54AEB7C70200007800052C4D@mail.emea.novell.com> <54AEBA9F0200007800052C91@mail.emea.novell.com> <20150109160206.GF2726@l.oracle.com> <54AFFD3A.2010005@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Y9cPj-0001KS-3I for xen-devel@lists.xenproject.org; Fri, 09 Jan 2015 16:27:55 +0000 Content-Disposition: inline In-Reply-To: <54AFFD3A.2010005@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: Andrew Cooper Cc: Keir Fraser , Tim Deegan , Ian Jackson , Ian Campbell , Jan Beulich , xen-devel List-Id: xen-devel@lists.xenproject.org On Fri, Jan 09, 2015 at 04:09:30PM +0000, Andrew Cooper wrote: > On 09/01/15 16:02, Konrad Rzeszutek Wilk wrote: > > On Thu, Jan 08, 2015 at 04:13:03PM +0000, Jan Beulich wrote: > >> ... as generally being a cheaper operation. > > I was wondering if it would be possible to change some of the > > EFLAGS after when we go in the 'cpu_relax' - and an interrupt > > happens, we process it, alter the EFLAGS, then when we are > > done, the EFLAGS are different - which the original code would > > save when it was done sitting on the cpu_relax() loop. > > > > Actually that sounds bad - we only want to restore the flags > > that we had when going in this spin lock. Would make sense > > to add an ASSERT to check for flags being different from the > > EFLAGS? > > local_irq_restore() only restores the interrupt flag from flags. All > other bits in EFLAGS are unmodified. which I would have found out if I read the code from local_irq_restore(). Sorry about the noise - should have looked at the code before asking questions! > > ~Andrew