All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: Joshua Kinard <kumba@gentoo.org>
Cc: Linux MIPS List <linux-mips@linux-mips.org>
Subject: Re: [PATCH]: Improve atomic.h robustness
Date: Tue, 14 Aug 2012 14:37:13 +0200	[thread overview]
Message-ID: <20120814123713.GB17040@linux-mips.org> (raw)
In-Reply-To: <4FE7B86E.7030601@gentoo.org>

On Sun, Jun 24, 2012 at 09:01:34PM -0400, Joshua Kinard wrote:

> I've maintained this patch, originally from Thiemo Seufer in 2004, for a
> really long time, but I think it's time for it to get a look at for possible
> inclusion.  I have had no problems with it across various SGI systems over
> the years.
> 
> To quote the post here:
> http://www.linux-mips.org/archives/linux-mips/2004-12/msg00000.html
> 
> "the atomic functions use so far memory references for the inline
> assembler to access the semaphore. This can lead to additional
> instructions in the ll/sc loop, because newer compilers don't
> expand the memory reference any more but leave it to the assembler.
> 
> The appended patch uses registers instead, and makes the ll/sc
> arguments more explicit. In some cases it will lead also to better
> register scheduling because the register isn't bound to an output
> any more."

I have faint memories of having tried this myself and very ancient
compilers didn't like the + constraint in inline assembler; somewhat
less ancient compilers did generate slightly bigger code.  With gcc 4.7
I am getting exactly the same codesize as without your patch applied.
The patch shouldn't do anything to robustness but sureles makes the
inline assembler a bit more readable so I'm queueing this for the next
release.

Thanks,

  Ralf

      reply	other threads:[~2012-08-14 12:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-25  1:01 [PATCH]: Improve atomic.h robustness Joshua Kinard
2012-08-14 12:37 ` Ralf Baechle [this message]

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=20120814123713.GB17040@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=kumba@gentoo.org \
    --cc=linux-mips@linux-mips.org \
    /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.