Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: Morten Larsen <mlarsen@broadcom.com>
Cc: linux-mips@linux-mips.org
Subject: Re: Bug in atomic_sub_if_positive
Date: Thu, 26 Jun 2008 14:11:20 +0200	[thread overview]
Message-ID: <20080626121120.GA5222@linux-mips.org> (raw)
In-Reply-To: <ADD7831BD377A74E9A1621D1EAAED18F0442AF00@NT-SJCA-0750.brcm.ad.broadcom.com>

On Wed, Jun 25, 2008 at 11:07:24PM -0700, Morten Larsen wrote:

> As far as I can tell the branch optimization fixes in 2.6.21 introduced
> a bug in atomic_sub_if_positive that causes it to return even when the
> sc instruction fails. The result is that e.g. down_trylock becomes
> unreliable as the semaphore counter is not always decremented.

I did play with a test program and can't reproduce the effect with my
assembler.  I have darm memories of gas immitating some obscure behaviour
of the IRIX assembler and I think it doesn't do so for all MIPS targets.

So I'm wandering what toolchain have you been using?

  Ralf

  reply	other threads:[~2008-06-26 12:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-26  6:07 Bug in atomic_sub_if_positive Morten Larsen
2008-06-26 12:11 ` Ralf Baechle [this message]
2008-06-27  6:00   ` Morten Larsen
  -- strict thread matches above, loose matches on Subject: below --
2008-07-02  0:12 Morten Larsen
2008-07-02  9:59 ` Thiemo Seufer
2008-07-02 10:31   ` Atsushi Nemoto
2008-07-02 10:51     ` Thiemo Seufer
2008-07-03 15:04       ` Atsushi Nemoto
2008-07-04 11:54         ` Ralf Baechle

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=20080626121120.GA5222@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=linux-mips@linux-mips.org \
    --cc=mlarsen@broadcom.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