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 an

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

2007-12-16 Thread Jiang zhe
sum(&pl->events); > + > + __percpu_counter_add(&pl->events, -val + (val >> period), > PROP_BATCH); > + } else > + percpu_counter_set(&pl->events, 0); > + > pl->period = global_period; > spin_unlock_irqrestore