From: Akinobu Mita <akinobu.mita@gmail.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Christoph Hellwig <hch@infradead.org>,
linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 1/5] bitops: add generic implementation of ext2 atomic bitops by test_and_{set,clear}_bit
Date: Tue, 12 Oct 2010 12:39:37 +0900 [thread overview]
Message-ID: <AANLkTik95xrOw0Y_=63EiJ-EGh95XZGeqMy_-HXorqCS@mail.gmail.com> (raw)
In-Reply-To: <201010101836.52406.arnd@arndb.de>
2010/10/11 Arnd Bergmann <arnd@arndb.de>:
> On Sunday 10 October 2010 17:07:26 Akinobu Mita wrote:
>> Some architectures use spinlock to implement it
>> (asm-generic/bitops/ext2-atomic.h). Most other architectures use
>> test_and_set_bit() and test_and_clear_bit() as this patch shows.
>>
>> Why are there two implementations? test_and_{set,clear}_bit() are more
>> costly operations than spinlock for some architectures?
>
> I would guess that is only true on architectures that implement all atomics
> using a hashed spinlock like cris, sparc32 or parisc. This way the user
> can decide which spinlock to use rather than have the arch code calculate
> a hash on the pointer.
Thanks. It looks quite right.
> This is an ext2 specific micro-optimization that I don't think makes
> sense in the generic le bitops code.
OK, I'll only rename ext2 non-atomic bitops to le bitops and
keep ext2 atomic bitops for now.
prev parent reply other threads:[~2010-10-12 3:39 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-08 10:03 [PATCH 1/5] bitops: add generic implementation of ext2 atomic bitops by test_and_{set,clear}_bit Akinobu Mita
2010-10-08 10:03 ` Akinobu Mita
2010-10-08 10:03 ` [PATCH 2/5] bitops: cleanup asm-generic/bitops/le.h Akinobu Mita
2010-10-08 10:03 ` Akinobu Mita
2010-10-08 10:03 ` [PATCH 3/5] kvm: stop including asm-generic/bitops/le.h directly Akinobu Mita
2010-10-08 10:03 ` Akinobu Mita
2010-10-08 12:45 ` Alexander Graf
2010-10-08 10:03 ` [PATCH 4/5] rds: " Akinobu Mita
2010-10-08 10:03 ` Akinobu Mita
2010-10-08 18:55 ` Andy Grover
2010-10-08 18:59 ` David Miller
2010-10-08 18:59 ` David Miller
2010-10-10 15:09 ` Akinobu Mita
2010-10-10 15:09 ` Akinobu Mita
2010-10-08 10:03 ` [PATCH 5/5] bitops: forbid asm-generic/bitops/le.h direct inclusion Akinobu Mita
2010-10-08 10:03 ` Akinobu Mita
2010-10-08 10:24 ` [PATCH 1/5] bitops: add generic implementation of ext2 atomic bitops by test_and_{set,clear}_bit Christoph Hellwig
2010-10-08 10:24 ` Christoph Hellwig
2010-10-10 15:07 ` Akinobu Mita
2010-10-10 16:36 ` Arnd Bergmann
2010-10-12 3:39 ` Akinobu Mita [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='AANLkTik95xrOw0Y_=63EiJ-EGh95XZGeqMy_-HXorqCS@mail.gmail.com' \
--to=akinobu.mita@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=hch@infradead.org \
--cc=linux-arch@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;
as well as URLs for NNTP newsgroup(s).