Re: [PATCH 7/8] IPMI: convert locked counters to atomics

2008-02-13 Thread Corey Minyard
Andrew Morton wrote: The code forgot to initialise all of these. It just so happens that the all-bits-zero pattern works correctly for all current architectures, so the code should work OK. But there is no reason (I hope) why an architecture cannot implement atomic_t as struct atomic_t {

Re: [PATCH 7/8] IPMI: convert locked counters to atomics

2008-02-13 Thread Andrew Morton
On Wed, 13 Feb 2008 10:32:20 -0600 Corey Minyard <[EMAIL PROTECTED]> wrote: > From: Konstantin Baydarov <[EMAIL PROTECTED]> > > Atomics are a lot more efficient and neat than using a lock. > Yes, but... > +struct ipmi_stats > +{ > + /* Commands we got that were invalid. */ > +

[PATCH 7/8] IPMI: convert locked counters to atomics

2008-02-13 Thread Corey Minyard
From: Konstantin Baydarov <[EMAIL PROTECTED]> Atomics are a lot more efficient and neat than using a lock. Signed-off-by: Konstantin Baydarov <[EMAIL PROTECTED]> Signed-off-by: Corey Minyard <[EMAIL PROTECTED]> --- Index: linux-2.6.24/drivers/char/ipmi/ipmi_msghandler.c

[PATCH 7/8] IPMI: convert locked counters to atomics

2008-02-13 Thread Corey Minyard
From: Konstantin Baydarov [EMAIL PROTECTED] Atomics are a lot more efficient and neat than using a lock. Signed-off-by: Konstantin Baydarov [EMAIL PROTECTED] Signed-off-by: Corey Minyard [EMAIL PROTECTED] --- Index: linux-2.6.24/drivers/char/ipmi/ipmi_msghandler.c

Re: [PATCH 7/8] IPMI: convert locked counters to atomics

2008-02-13 Thread Andrew Morton
On Wed, 13 Feb 2008 10:32:20 -0600 Corey Minyard [EMAIL PROTECTED] wrote: From: Konstantin Baydarov [EMAIL PROTECTED] Atomics are a lot more efficient and neat than using a lock. Yes, but... +struct ipmi_stats +{ + /* Commands we got that were invalid. */ + atomic_t

Re: [PATCH 7/8] IPMI: convert locked counters to atomics

2008-02-13 Thread Corey Minyard
Andrew Morton wrote: The code forgot to initialise all of these. It just so happens that the all-bits-zero pattern works correctly for all current architectures, so the code should work OK. But there is no reason (I hope) why an architecture cannot implement atomic_t as struct atomic_t {