Re: [PATCH] lib: proportion: fix underflow in prop_norm_percpu()

2007-12-16 Thread Jiang zhe
t;events, -val + (val >> period), > PROP_BATCH); > + } else > + percpu_counter_set(>events, 0); > + > pl->period = global_period; > spin_unlock_irqrestore(>lock, flags); > } > @@ -267,7 +261,7 @@ void __prop_inc_percpu(struct pr

Re: [PATCH] lib: proportion: fix underflow in prop_norm_percpu()

2007-12-16 Thread Jiang zhe
On Fri, 2007-12-14 at 17:01 +0100, Peter Zijlstra wrote: > Subject: lib: proportion: fix underflow in prop_norm_percpu() > > Zhe Jiang noticed that its possible to underflow pl->events in > prop_norm_percpu() when the value returned by percpu_counter_read() is less > than the error on that read

Re: [PATCH] lib: proportion: fix underflow in prop_norm_percpu()

2007-12-16 Thread Jiang zhe
On Fri, 2007-12-14 at 17:01 +0100, Peter Zijlstra wrote: Subject: lib: proportion: fix underflow in prop_norm_percpu() Zhe Jiang noticed that its possible to underflow pl-events in prop_norm_percpu() when the value returned by percpu_counter_read() is less than the error on that read and the

Re: [PATCH] lib: proportion: fix underflow in prop_norm_percpu()

2007-12-16 Thread Jiang zhe
); + __percpu_counter_add(pl-events, 1, PROP_BATCH); percpu_counter_add(pg-events, 1); prop_put_global(pd, pg); } Reviewed-by: Jiang Zhe [EMAIL PROTECTED] Thanks! -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL