Re: [PATCH] New operation for kref to help avoid locks

2005-03-01 Thread Nick Piggin
Corey Minyard wrote: Nick Piggin wrote: Is get_with_check actually going to be useful for anything? It seems like it promotes complex and potentially unsafe schemes. It is certainly more complex to use this, and I'm guessing that's why Greg rejected it. Certainly a valid problem. eg. In your

Re: [PATCH] New operation for kref to help avoid locks

2005-03-01 Thread Corey Minyard
Nick Piggin wrote: Corey Minyard wrote: Arjan van de Ven wrote: Just doing an atomic operation is not faster than doing a lock, an atomic operation, then an unlock? Am I missing something? if the lock and the atomic are on the same cacheline they're the same cost on most modern cpus...

Re: [PATCH] New operation for kref to help avoid locks

2005-03-01 Thread Nick Piggin
Corey Minyard wrote: Arjan van de Ven wrote: Just doing an atomic operation is not faster than doing a lock, an atomic operation, then an unlock? Am I missing something? if the lock and the atomic are on the same cacheline they're the same cost on most modern cpus... Ah, I see. Not

Re: [PATCH] New operation for kref to help avoid locks

2005-03-01 Thread Corey Minyard
Arjan van de Ven wrote: Just doing an atomic operation is not faster than doing a lock, an atomic operation, then an unlock? Am I missing something? if the lock and the atomic are on the same cacheline they're the same cost on most modern cpus... Ah, I see. Not likely to ever be the

Re: [PATCH] New operation for kref to help avoid locks

2005-03-01 Thread Arjan van de Ven
> Just doing an atomic operation is not faster than doing a lock, an > atomic operation, then an unlock? Am I missing something? if the lock and the atomic are on the same cacheline they're the same cost on most modern cpus... - To unsubscribe from this list: send the line "unsubscribe

Re: [PATCH] New operation for kref to help avoid locks

2005-03-01 Thread Corey Minyard
Arjan van de Ven wrote: On Tue, 2005-03-01 at 12:15 -0800, Greg KH wrote: On Sat, Feb 26, 2005 at 04:23:04PM -0600, Corey Minyard wrote: Add a routine to kref that allows the kref_put() routine to be unserialized even when the get routine attempts to kref_get() an object without first

Re: [PATCH] New operation for kref to help avoid locks

2005-03-01 Thread Greg KH
On Tue, Mar 01, 2005 at 10:02:43PM +0100, Arjan van de Ven wrote: > On Tue, 2005-03-01 at 12:15 -0800, Greg KH wrote: > > On Sat, Feb 26, 2005 at 04:23:04PM -0600, Corey Minyard wrote: > > > Add a routine to kref that allows the kref_put() routine to be > > > unserialized even when the get routine

Re: [PATCH] New operation for kref to help avoid locks

2005-03-01 Thread Arjan van de Ven
On Tue, 2005-03-01 at 12:15 -0800, Greg KH wrote: > On Sat, Feb 26, 2005 at 04:23:04PM -0600, Corey Minyard wrote: > > Add a routine to kref that allows the kref_put() routine to be > > unserialized even when the get routine attempts to kref_get() > > an object without first holding a valid

Re: [PATCH] New operation for kref to help avoid locks

2005-03-01 Thread Greg KH
On Sat, Feb 26, 2005 at 04:23:04PM -0600, Corey Minyard wrote: > Add a routine to kref that allows the kref_put() routine to be > unserialized even when the get routine attempts to kref_get() > an object without first holding a valid reference to it. This is > useful in situations where this

Re: [PATCH] New operation for kref to help avoid locks

2005-03-01 Thread Greg KH
On Sat, Feb 26, 2005 at 04:23:04PM -0600, Corey Minyard wrote: Add a routine to kref that allows the kref_put() routine to be unserialized even when the get routine attempts to kref_get() an object without first holding a valid reference to it. This is useful in situations where this happens

Re: [PATCH] New operation for kref to help avoid locks

2005-03-01 Thread Arjan van de Ven
On Tue, 2005-03-01 at 12:15 -0800, Greg KH wrote: On Sat, Feb 26, 2005 at 04:23:04PM -0600, Corey Minyard wrote: Add a routine to kref that allows the kref_put() routine to be unserialized even when the get routine attempts to kref_get() an object without first holding a valid reference to

Re: [PATCH] New operation for kref to help avoid locks

2005-03-01 Thread Greg KH
On Tue, Mar 01, 2005 at 10:02:43PM +0100, Arjan van de Ven wrote: On Tue, 2005-03-01 at 12:15 -0800, Greg KH wrote: On Sat, Feb 26, 2005 at 04:23:04PM -0600, Corey Minyard wrote: Add a routine to kref that allows the kref_put() routine to be unserialized even when the get routine attempts

Re: [PATCH] New operation for kref to help avoid locks

2005-03-01 Thread Corey Minyard
Arjan van de Ven wrote: On Tue, 2005-03-01 at 12:15 -0800, Greg KH wrote: On Sat, Feb 26, 2005 at 04:23:04PM -0600, Corey Minyard wrote: Add a routine to kref that allows the kref_put() routine to be unserialized even when the get routine attempts to kref_get() an object without first

Re: [PATCH] New operation for kref to help avoid locks

2005-03-01 Thread Arjan van de Ven
Just doing an atomic operation is not faster than doing a lock, an atomic operation, then an unlock? Am I missing something? if the lock and the atomic are on the same cacheline they're the same cost on most modern cpus... - To unsubscribe from this list: send the line unsubscribe

Re: [PATCH] New operation for kref to help avoid locks

2005-03-01 Thread Corey Minyard
Arjan van de Ven wrote: Just doing an atomic operation is not faster than doing a lock, an atomic operation, then an unlock? Am I missing something? if the lock and the atomic are on the same cacheline they're the same cost on most modern cpus... Ah, I see. Not likely to ever be the

Re: [PATCH] New operation for kref to help avoid locks

2005-03-01 Thread Nick Piggin
Corey Minyard wrote: Arjan van de Ven wrote: Just doing an atomic operation is not faster than doing a lock, an atomic operation, then an unlock? Am I missing something? if the lock and the atomic are on the same cacheline they're the same cost on most modern cpus... Ah, I see. Not

Re: [PATCH] New operation for kref to help avoid locks

2005-03-01 Thread Corey Minyard
Nick Piggin wrote: Corey Minyard wrote: Arjan van de Ven wrote: Just doing an atomic operation is not faster than doing a lock, an atomic operation, then an unlock? Am I missing something? if the lock and the atomic are on the same cacheline they're the same cost on most modern cpus...

Re: [PATCH] New operation for kref to help avoid locks

2005-03-01 Thread Nick Piggin
Corey Minyard wrote: Nick Piggin wrote: Is get_with_check actually going to be useful for anything? It seems like it promotes complex and potentially unsafe schemes. It is certainly more complex to use this, and I'm guessing that's why Greg rejected it. Certainly a valid problem. eg. In your

Re: [PATCH] New operation for kref to help avoid locks

2005-02-26 Thread Corey Minyard
Sergey Vlasov wrote: On Sat, 26 Feb 2005 09:55:41 -0600 Corey Minyard wrote: Greg, This is the patch for krefs that we talked about. If you don't like it but like the docs, feel free just to take the documentation and cut out the stuff at the end about the new operation. See below for

Re: [PATCH] New operation for kref to help avoid locks

2005-02-26 Thread Sergey Vlasov
On Sat, 26 Feb 2005 09:55:41 -0600 Corey Minyard wrote: > Greg, > > This is the patch for krefs that we talked about. If you don't like it > but like the docs, feel free just to take the documentation and cut out > the stuff at the end about the new operation. See below for comments to the

[PATCH] New operation for kref to help avoid locks

2005-02-26 Thread Corey Minyard
Greg, This is the patch for krefs that we talked about. If you don't like it but like the docs, feel free just to take the documentation and cut out the stuff at the end about the new operation. Thanks, -Corey Add a routine to kref that allows the kref_put() routine to be unserialized even

[PATCH] New operation for kref to help avoid locks

2005-02-26 Thread Corey Minyard
Greg, This is the patch for krefs that we talked about. If you don't like it but like the docs, feel free just to take the documentation and cut out the stuff at the end about the new operation. Thanks, -Corey Add a routine to kref that allows the kref_put() routine to be unserialized even

Re: [PATCH] New operation for kref to help avoid locks

2005-02-26 Thread Sergey Vlasov
On Sat, 26 Feb 2005 09:55:41 -0600 Corey Minyard wrote: Greg, This is the patch for krefs that we talked about. If you don't like it but like the docs, feel free just to take the documentation and cut out the stuff at the end about the new operation. See below for comments to the patch.

Re: [PATCH] New operation for kref to help avoid locks

2005-02-26 Thread Corey Minyard
Sergey Vlasov wrote: On Sat, 26 Feb 2005 09:55:41 -0600 Corey Minyard wrote: Greg, This is the patch for krefs that we talked about. If you don't like it but like the docs, feel free just to take the documentation and cut out the stuff at the end about the new operation. See below for