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@linux-mips.org
Subject: Re: Question regarding atomic ops
Date: Tue, 10 Oct 2017 16:23:06 +0200	[thread overview]
Message-ID: <20171010142306.GA24194@linux-mips.org> (raw)
In-Reply-To: <4f77107c-18ba-d549-c5f2-d52d0460377b@gentoo.org>

On Mon, Oct 09, 2017 at 10:34:43PM -0400, Joshua Kinard wrote:

> On 10/09/2017 22:24, Joshua Kinard wrote:
> 
> [snip]
> 
> > This raises the question of why was the standard "kernel_uses_llsc" case
> > changed but not the R10000_LLSC_WAR case?  The changes seem like they would be
> > applicable to the older R10K CPUs regardless, since this is before a lot of the
> > code for the newer ISAs (R2+) was added.  I am getting a funny feeling that a
> > lot of these templates need to be re-written (maybe even in plain C, given
> > newer gcc's better intelligence) and other useful cleanups done.  I am not
> > fluent in MIPS asm enough, though, to know what to change.
> 
> Answered one of my own questions via this buried commit from ~2006/2007 that
> has a commit message, but no changed files:
> 
> https://git.linux-mips.org/cgit/ralf/linux.git/commit/arch/mips/include/asm/atomic.h?id=5999eca25c1fd4b9b9aca7833b04d10fe4bc877d
> 
> > [MIPS] Improve branch prediction in ll/sc atomic operations.
> > Now that finally all supported versions of binutils have functioning
> > support for .subsection use .subsection to tweak the branch prediction
> > 
> > I did not modify the R10000 errata variants because it seems unclear if
> > this will invalidate the workaround which actually relies on the cheesy
> > prediction of branch likely to cause a misspredict if the sc was
> > successful.
> > 
> > Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
> 
> Seems like that second paragraph is a ripe candidate for a comment block so
> this is better documented :)

Btw, I reasonably certain applying the change to the R10000 LL/SC workaround
versions as well would work.  But testing is difficult, even with hardware
at hand - and the other option asing a R10000 RTL designer is tricky about
20 years later!

  Ralf

  reply	other threads:[~2017-10-10 14:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-10  2:24 Question regarding atomic ops Joshua Kinard
2017-10-10  2:34 ` Joshua Kinard
2017-10-10 14:23   ` Ralf Baechle [this message]
2017-10-11 13:15     ` Joshua Kinard
2017-10-11 13:15       ` Joshua Kinard
2017-10-16  5:51     ` Joshua Kinard
2017-10-25  7:59       ` James Hogan
2017-10-25  7:59         ` James Hogan

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=20171010142306.GA24194@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.