From: Ralf Baechle <ralf@linux-mips.org>
To: David Daney <ddaney@caviumnetworks.com>
Cc: linux-mips@linux-mips.org
Subject: Re: [PATCH 1/2] MIPS: Allow kernel use of ll/sc to be separate from the presence of ll/sc.
Date: Wed, 5 Aug 2009 02:18:21 +0100 [thread overview]
Message-ID: <20090805011820.GA16950@linux-mips.org> (raw)
In-Reply-To: <1247508920-29153-1-git-send-email-ddaney@caviumnetworks.com>
On Mon, Jul 13, 2009 at 11:15:19AM -0700, David Daney wrote:
> On some CPUs, it is more efficient to disable and enable interrupts in
> the kernel rather than use ll/sc for atomic operations. But if we
> were to set cpu_has_llsc to false, we would break the userspace futex
> interface (in asm/futex.h).
>
> We separate the two concepts, with a new predicate kernel_uses_llsc,
> that lets us disable the kernel's use of ll/sc while still allowing
> the futex code to use it.
>
> Also there were a couple of cases in bitops.h where we were using
> ll/sc unconditionally even if cpu_has_llsc were false. There are
> several places in assembly code where the configure variable
> CONFIG_CPU_HAS_LLSC is used instead of cpu_has_llsc, so we make
> cpu_has_llsc true if CONFIG_CPU_HAS_LLSC is set, for consistency.
The uses in bitops.h you mentioned were not bugs; they were wrapped in
#ifdef CONFIG_CPU_MIPSR2 and MIPS R2 implies having LL/SC. So for sane
setups there just is no point in bothering.
As discussed on IRC - this patch adds one more use of CONFIG_CPU_HAS_LLSC
which really should die. So I turned the remaining CONFIG_CPU_HAS_LLSC
users further upside down, removed CONFIG_CPU_HAS_LLSC and applied your
patch with the necessary adjustments on top.
Thanks!
Ralf
prev parent reply other threads:[~2009-08-05 1:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-13 18:15 [PATCH 1/2] MIPS: Allow kernel use of ll/sc to be separate from the presence of ll/sc David Daney
2009-07-13 18:15 ` [PATCH 2/2] MIPS: Octeon: Set kernel_uses_llsc to false on non-SMP builds David Daney
2009-08-05 1:18 ` 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=20090805011820.GA16950@linux-mips.org \
--to=ralf@linux-mips.org \
--cc=ddaney@caviumnetworks.com \
--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 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).