linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: "Aguirre, Sergio" <saaguirre@ti.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Huang Ying <ying.huang@intel.com>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>,
	Ingo Molnar <mingo@elte.hu>, Kyle McMartin <kyle@mcmartin.ca>
Subject: RE: [RFC][PATCH] irq_work: Don't ignore possible cmpxchg failure
Date: Tue, 16 Nov 2010 18:08:46 +0100	[thread overview]
Message-ID: <1289927326.2109.631.camel@laptop> (raw)
In-Reply-To: <A24693684029E5489D1D202277BE89447382A55A@dlee02.ent.ti.com>

On Tue, 2010-11-16 at 10:57 -0600, Aguirre, Sergio wrote:

> > > @@ -145,7 +145,10 @@ void irq_work_run(void)
> > >  		 * Clear the BUSY bit and return to the free state if
> > >  		 * no-one else claimed it meanwhile.
> > >  		 */
> > > -		cmpxchg(&entry->next, next_flags(NULL, IRQ_WORK_BUSY), NULL);
> > > +		xchgres = cmpxchg(&entry->next,
> > > +				  next_flags(NULL, IRQ_WORK_BUSY),
> > > +				  NULL);
> > > +		BUG_ON(unlikely(xchgres != next_flags(NULL, IRQ_WORK_BUSY)));
> > 
> > simply adding (void) in front would be much easier.
> 
> But isn't that still leaving the remote possibility of a hidden cmpxchg
> Failure open?

No, we don't care if it fails, read the comment. All we want to know is
that if it still matched, we flipped the bit.

  reply	other threads:[~2010-11-16 17:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-16 16:32 [RFC][PATCH] irq_work: Don't ignore possible cmpxchg failure Sergio Aguirre
2010-11-16 16:45 ` Peter Zijlstra
2010-11-16 16:57   ` Aguirre, Sergio
2010-11-16 17:08     ` Peter Zijlstra [this message]
2010-11-16 17:11       ` Aguirre, Sergio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1289927326.2109.631.camel@laptop \
    --to=a.p.zijlstra@chello.nl \
    --cc=kyle@mcmartin.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=saaguirre@ti.com \
    --cc=schwidefsky@de.ibm.com \
    --cc=ying.huang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).