All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: Thiemo Seufer <ths@networkno.de>
Cc: Fuxin Zhang <fxzhang@ict.ac.cn>, linux-mips@linux-mips.org
Subject: Re: cmpxchg broken in some situation
Date: Wed, 3 Oct 2007 00:15:48 +0100	[thread overview]
Message-ID: <20071002231548.GA1240@linux-mips.org> (raw)
In-Reply-To: <20071002142210.GD16772@networkno.de>

On Tue, Oct 02, 2007 at 03:22:10PM +0100, Thiemo Seufer wrote:

> > +#define __cmpxchg(ptr,old,new,barrier)					\
> > +({									\
> > +	__typeof__(ptr) __ptr = (ptr);					\
> > +	__typeof__(*(ptr)) __old = (old);				\
> > +	__typeof__(*(ptr)) __new = (new);				\
> > +	__typeof__(*(ptr)) __res = 0;					\
> 
> Maybe we need an acquire barrier here for some systems.

Release you meant.  The acquire lock would be at the end.  Documentation
and actual implmeentations of cmpxchg seem to differ.  It's a relativly
rarely used primitve so I think I err on the side of paranoia for now
and throw in the additional SYNC you suggest.

  Ralf

  reply	other threads:[~2007-10-02 23:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-30 10:34 cmpxchg broken in some situation Fuxin Zhang
2007-10-01  2:53 ` Ralf Baechle
2007-10-01  3:56   ` David Daney
2007-10-01  3:59     ` David Daney
2007-10-01 10:24       ` Ralf Baechle
2007-10-01 15:11   ` Fuxin Zhang
2007-10-01 15:26     ` Ralf Baechle
2007-10-02  9:34       ` Fuxin Zhang
2007-10-02 10:35         ` Ralf Baechle
2007-10-02 14:22           ` Thiemo Seufer
2007-10-02 23:15             ` Ralf Baechle [this message]
2007-10-02 22:48           ` Fuxin Zhang
2007-10-02 22:52             ` Ralf Baechle
2007-10-02 23:07               ` Fuxin Zhang

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=20071002231548.GA1240@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=fxzhang@ict.ac.cn \
    --cc=linux-mips@linux-mips.org \
    --cc=ths@networkno.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.