From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Christoph Lameter <clameter@sgi.com>
Cc: Andi Kleen <ak@suse.de>,
Zoltan Menyhart <Zoltan.Menyhart@bull.net>,
"Boehm, Hans" <hans.boehm@hp.com>,
"Grundler, Grant G" <grant.grundler@hp.com>,
"Chen, Kenneth W" <kenneth.w.chen@intel.com>,
akpm@osdl.org, linux-kernel@vger.kernel.org,
linux-ia64@vger.kernel.org
Subject: Re: Synchronizing Bit operations V2
Date: Sun, 2 Apr 2006 08:54:04 +0100 [thread overview]
Message-ID: <20060402075403.GA19149@flint.arm.linux.org.uk> (raw)
In-Reply-To: <Pine.LNX.4.64.0603310952540.6825@schroedinger.engr.sgi.com>
On Fri, Mar 31, 2006 at 09:56:23AM -0800, Christoph Lameter wrote:
> On Fri, 31 Mar 2006, Andi Kleen wrote:
>
> > > Powerpc can do similar things AFAIK. Not sure what other arches have
> > > finer grained control over barriers but it could cover a lot of special
> > > cases for other processors as well.
> >
> > Yes, but I don't think the goal of a portable atomic operations API
> > in Linux is it to cover everybody's special case in every possible
> > combination. The goal is to have an abstraction that will lead to
> > portable code. I don't think your proposal will do this.
>
> AFAIK The goal of a bitmap operations API (we are not talking about atomic
> operations here) is to make bitmap operations as efficient as possible and
> as simple as possible.
If we are not talking about atomic operations...
> We already have multiple special cases for each
> bitmap operation
>
> I.e.
>
> clear_bit()
why do you then bring up the atomic bitop operation here?
> __clear_bit()
this is the non-atomic bitop operation.
> and some people talk abouit
>
> clear_bit_lock()
> clear_bit_unlock()
Neither of these exist in the kernel.
> What I am prosing is to do one clear_bit_mode function that can take a
> parameter customizing its synchronization behavior.
>
> clear_bit_mode(bit,addr,mode)
Which means for architectures which implement bitops out of line (due
to their size) that you end up making those architectures even more
inefficient because they now have to decode the "mode" parameter which
will take several compares and branches.
The only way around that would be for such architectures to do:
#define clear_bit_mode(bit,addr,mode) clear_bit_mode_##mode(bit,addr)
and then we're back to the named function approach.
Incidentally, you say that the named function approach is not extensible.
Do you have a limit on the number of functions you can have in your
kernel? If not, I don't see where such a statement would come from -
you obviously can extend "clear_bit_atomic" and "clear_bit_nonatomic"
by adding eg, "clear_bit_barrier". And if you really want to multiplex
them through one function, you can do:
#define clear_bit_atomic(bit,addr) clear_bit_mode(bit,addr,MODE_ATOMIC)
#define clear_bit_nonatomic(bit,addr) clear_bit_mode(bit,addr,MODE_NONATOMIC)
#define clear_bit_barrier(bit,addr) clear_bit_mode(bit,addr,MODE_BARRIER)
etc.
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core
next prev parent reply other threads:[~2006-04-02 7:54 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-30 21:02 Bit operations with the ability to specify a synchronization mode Christoph Lameter
2006-03-31 0:18 ` Synchronizing Bit operations V2 Christoph Lameter
2006-03-31 0:39 ` Chen, Kenneth W
2006-03-31 0:42 ` Christoph Lameter
2006-03-31 0:53 ` Chen, Kenneth W
2006-03-31 0:55 ` Christoph Lameter
2006-03-31 1:04 ` Chen, Kenneth W
2006-03-31 1:13 ` Christoph Lameter
2006-03-31 1:29 ` Chen, Kenneth W
2006-03-31 1:37 ` Christoph Lameter
2006-03-31 2:35 ` Chen, Kenneth W
2006-03-31 2:37 ` Christoph Lameter
2006-03-31 2:45 ` Chen, Kenneth W
2006-03-31 2:53 ` Nick Piggin
2006-03-31 6:15 ` Chen, Kenneth W
2006-03-31 7:34 ` Nick Piggin
2006-03-31 18:57 ` Chen, Kenneth W
2006-03-31 19:41 ` Chen, Kenneth W
2006-03-31 21:15 ` Christoph Lameter
2006-03-31 21:24 ` Chen, Kenneth W
2006-03-31 21:28 ` Christoph Lameter
2006-04-01 2:16 ` Nick Piggin
2006-03-31 3:01 ` Christoph Lameter
2006-03-31 3:10 ` Chen, Kenneth W
2006-03-31 3:12 ` Christoph Lameter
2006-03-31 3:14 ` Chen, Kenneth W
2006-03-31 3:20 ` Christoph Lameter
2006-03-31 3:37 ` Chen, Kenneth W
2006-03-31 3:17 ` Chen, Kenneth W
2006-03-31 3:23 ` Chen, Kenneth W
2006-03-31 0:45 ` Christoph Lameter
2006-03-31 0:50 ` Chen, Kenneth W
2006-03-31 0:51 ` Christoph Lameter
2006-03-31 0:59 ` Chen, Kenneth W
2006-03-31 1:09 ` Christoph Lameter
2006-03-31 1:13 ` Chen, Kenneth W
2006-03-31 0:42 ` David Mosberger-Tang
2006-03-31 0:49 ` Christoph Lameter
2006-03-31 6:10 ` Chris Wright
2006-03-31 0:44 ` Nick Piggin
2006-03-31 3:28 ` Christoph Lameter
2006-03-31 4:12 ` Nick Piggin
2006-03-31 17:43 ` Christoph Lameter
2006-04-01 2:56 ` Nick Piggin
2006-03-31 13:28 ` Andi Kleen
2006-03-31 16:22 ` Hans Boehm
2006-03-31 16:37 ` Andi Kleen
2006-03-31 17:46 ` Christoph Lameter
2006-03-31 17:45 ` Christoph Lameter
2006-03-31 17:48 ` Andi Kleen
2006-03-31 17:56 ` Christoph Lameter
2006-04-02 7:54 ` Russell King [this message]
-- strict thread matches above, loose matches on Subject: below --
2006-03-31 0:56 Luck, Tony
2006-03-31 0:58 ` Christoph Lameter
2006-04-02 7:59 ` Russell King
2006-03-31 1:33 linux
2006-03-31 1:40 ` Christoph Lameter
2006-03-31 2:51 Chen, Kenneth W
2006-03-31 2:55 ` Christoph Lameter
2006-03-31 3:02 ` Chen, Kenneth W
2006-03-31 3:08 ` Christoph Lameter
2006-03-31 3:11 ` Chen, Kenneth W
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=20060402075403.GA19149@flint.arm.linux.org.uk \
--to=rmk+lkml@arm.linux.org.uk \
--cc=Zoltan.Menyhart@bull.net \
--cc=ak@suse.de \
--cc=akpm@osdl.org \
--cc=clameter@sgi.com \
--cc=grant.grundler@hp.com \
--cc=hans.boehm@hp.com \
--cc=kenneth.w.chen@intel.com \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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