Re: [rfc] lock bitops

2007-05-09 Thread Nick Piggin
On Wed, May 09, 2007 at 04:08:41PM +0400, Nikita Danilov wrote: > Nick Piggin writes: > > Hi, > > [...] > > > > > /** > > + * clear_bit_unlock - Clears a bit in memory with release > > + * @nr: Bit to clear > > + * @addr: Address to start counting from > > + * > > + * clear_bit() is

Re: [rfc] lock bitops

2007-05-09 Thread Nikita Danilov
Nick Piggin writes: > Hi, [...] > > /** > + * clear_bit_unlock - Clears a bit in memory with release > + * @nr: Bit to clear > + * @addr: Address to start counting from > + * > + * clear_bit() is atomic and may not be reordered. It does s/clear_bit/clear_bit_unlock/ ? > + *

Re: [rfc] lock bitops

2007-05-09 Thread Nick Piggin
On Tue, May 08, 2007 at 01:22:56PM +0100, David Howells wrote: > Nick Piggin <[EMAIL PROTECTED]> wrote: > > > +There are two special bitops with lock barrier semantics (acquire/release, > > +same as spinlocks). > > You should update Documentation/memory-barriers.txt also. > > > #define

Re: [rfc] lock bitops

2007-05-09 Thread Nick Piggin
On Tue, May 08, 2007 at 01:22:56PM +0100, David Howells wrote: Nick Piggin [EMAIL PROTECTED] wrote: +There are two special bitops with lock barrier semantics (acquire/release, +same as spinlocks). You should update Documentation/memory-barriers.txt also. #define

Re: [rfc] lock bitops

2007-05-09 Thread Nikita Danilov
Nick Piggin writes: Hi, [...] /** + * clear_bit_unlock - Clears a bit in memory with release + * @nr: Bit to clear + * @addr: Address to start counting from + * + * clear_bit() is atomic and may not be reordered. It does s/clear_bit/clear_bit_unlock/ ? + * contain a

Re: [rfc] lock bitops

2007-05-09 Thread Nick Piggin
On Wed, May 09, 2007 at 04:08:41PM +0400, Nikita Danilov wrote: Nick Piggin writes: Hi, [...] /** + * clear_bit_unlock - Clears a bit in memory with release + * @nr: Bit to clear + * @addr: Address to start counting from + * + * clear_bit() is atomic and may not be

Re: [rfc] lock bitops

2007-05-08 Thread Nick Piggin
On Tue, May 08, 2007 at 04:40:36PM -0600, Matthew Wilcox wrote: > On Wed, May 09, 2007 at 12:29:27AM +0200, Nick Piggin wrote: > > On Tue, May 08, 2007 at 09:06:32AM -0600, Matthew Wilcox wrote: > > > On Tue, May 08, 2007 at 01:37:09PM +0200, Nick Piggin wrote: > > > > -- > > > > Introduce

Re: [rfc] lock bitops

2007-05-08 Thread Matthew Wilcox
On Wed, May 09, 2007 at 12:29:27AM +0200, Nick Piggin wrote: > On Tue, May 08, 2007 at 09:06:32AM -0600, Matthew Wilcox wrote: > > On Tue, May 08, 2007 at 01:37:09PM +0200, Nick Piggin wrote: > > > -- > > > Introduce test_and_set_bit_lock / clear_bit_unlock bitops with lock > > > semantics. > > >

Re: [rfc] lock bitops

2007-05-08 Thread Nick Piggin
On Tue, May 08, 2007 at 01:22:56PM +0100, David Howells wrote: > Nick Piggin <[EMAIL PROTECTED]> wrote: > > > This patch (along with the subsequent one to optimise unlock_page) reduces > > the overhead of lock_page/unlock_page (measured with page faults and a patch > > to lock the page in the

Re: [rfc] lock bitops

2007-05-08 Thread Nick Piggin
On Tue, May 08, 2007 at 09:06:32AM -0600, Matthew Wilcox wrote: > On Tue, May 08, 2007 at 01:37:09PM +0200, Nick Piggin wrote: > > -- > > Introduce test_and_set_bit_lock / clear_bit_unlock bitops with lock > > semantics. > > Add non-trivial for powerpc and ia64. Convert page lock, buffer lock, >

Re: [rfc] lock bitops

2007-05-08 Thread Benjamin Herrenschmidt
On Tue, 2007-05-08 at 09:06 -0600, Matthew Wilcox wrote: > On Tue, May 08, 2007 at 01:37:09PM +0200, Nick Piggin wrote: > > -- > > Introduce test_and_set_bit_lock / clear_bit_unlock bitops with lock > > semantics. > > Add non-trivial for powerpc and ia64. Convert page lock, buffer lock, > >

Re: [rfc] lock bitops

2007-05-08 Thread Matthew Wilcox
On Tue, May 08, 2007 at 01:37:09PM +0200, Nick Piggin wrote: > -- > Introduce test_and_set_bit_lock / clear_bit_unlock bitops with lock semantics. > Add non-trivial for powerpc and ia64. Convert page lock, buffer lock, > bit_spin_lock, tasklet locks to use the new locks. The names are a bit

Re: [rfc] lock bitops

2007-05-08 Thread David Howells
Nick Piggin <[EMAIL PROTECTED]> wrote: > This patch (along with the subsequent one to optimise unlock_page) reduces > the overhead of lock_page/unlock_page (measured with page faults and a patch > to lock the page in the fault handler) by about 425 cycles on my 2-way G5. Seems reasonable, though

[rfc] lock bitops

2007-05-08 Thread Nick Piggin
Hi, This patch (along with the subsequent one to optimise unlock_page) reduces the overhead of lock_page/unlock_page (measured with page faults and a patch to lock the page in the fault handler) by about 425 cycles on my 2-way G5. It also improves `dd if=big-sparse-file of=/dev/null`

[rfc] lock bitops

2007-05-08 Thread Nick Piggin
Hi, This patch (along with the subsequent one to optimise unlock_page) reduces the overhead of lock_page/unlock_page (measured with page faults and a patch to lock the page in the fault handler) by about 425 cycles on my 2-way G5. It also improves `dd if=big-sparse-file of=/dev/null`

Re: [rfc] lock bitops

2007-05-08 Thread David Howells
Nick Piggin [EMAIL PROTECTED] wrote: This patch (along with the subsequent one to optimise unlock_page) reduces the overhead of lock_page/unlock_page (measured with page faults and a patch to lock the page in the fault handler) by about 425 cycles on my 2-way G5. Seems reasonable, though

Re: [rfc] lock bitops

2007-05-08 Thread Matthew Wilcox
On Tue, May 08, 2007 at 01:37:09PM +0200, Nick Piggin wrote: -- Introduce test_and_set_bit_lock / clear_bit_unlock bitops with lock semantics. Add non-trivial for powerpc and ia64. Convert page lock, buffer lock, bit_spin_lock, tasklet locks to use the new locks. The names are a bit clumsy.

Re: [rfc] lock bitops

2007-05-08 Thread Benjamin Herrenschmidt
On Tue, 2007-05-08 at 09:06 -0600, Matthew Wilcox wrote: On Tue, May 08, 2007 at 01:37:09PM +0200, Nick Piggin wrote: -- Introduce test_and_set_bit_lock / clear_bit_unlock bitops with lock semantics. Add non-trivial for powerpc and ia64. Convert page lock, buffer lock, bit_spin_lock,

Re: [rfc] lock bitops

2007-05-08 Thread Nick Piggin
On Tue, May 08, 2007 at 09:06:32AM -0600, Matthew Wilcox wrote: On Tue, May 08, 2007 at 01:37:09PM +0200, Nick Piggin wrote: -- Introduce test_and_set_bit_lock / clear_bit_unlock bitops with lock semantics. Add non-trivial for powerpc and ia64. Convert page lock, buffer lock,

Re: [rfc] lock bitops

2007-05-08 Thread Nick Piggin
On Tue, May 08, 2007 at 01:22:56PM +0100, David Howells wrote: Nick Piggin [EMAIL PROTECTED] wrote: This patch (along with the subsequent one to optimise unlock_page) reduces the overhead of lock_page/unlock_page (measured with page faults and a patch to lock the page in the fault

Re: [rfc] lock bitops

2007-05-08 Thread Matthew Wilcox
On Wed, May 09, 2007 at 12:29:27AM +0200, Nick Piggin wrote: On Tue, May 08, 2007 at 09:06:32AM -0600, Matthew Wilcox wrote: On Tue, May 08, 2007 at 01:37:09PM +0200, Nick Piggin wrote: -- Introduce test_and_set_bit_lock / clear_bit_unlock bitops with lock semantics. Add

Re: [rfc] lock bitops

2007-05-08 Thread Nick Piggin
On Tue, May 08, 2007 at 04:40:36PM -0600, Matthew Wilcox wrote: On Wed, May 09, 2007 at 12:29:27AM +0200, Nick Piggin wrote: On Tue, May 08, 2007 at 09:06:32AM -0600, Matthew Wilcox wrote: On Tue, May 08, 2007 at 01:37:09PM +0200, Nick Piggin wrote: -- Introduce test_and_set_bit_lock