Re: [PATCH]Avoid the overflow when calculate the proportion of bdi quota

2007-12-14 Thread zhejiang
On Thu, 2007-12-13 at 22:54 +0100, Peter Zijlstra wrote: > On Thu, 2007-12-13 at 11:30 +0800, zhejiang wrote: > > __percpu_counter_add() cache the result in percpu variable until it > > exceeds the batch. > > The prop_norm_percpu() use the percpu_counter_read(&pl->eve

[PATCH]Avoid the overflow when calculate the proportion of bdi quota

2007-12-12 Thread zhejiang
__percpu_counter_add() cache the result in percpu variable until it exceeds the batch. The prop_norm_percpu() use the percpu_counter_read(&pl->events) to read the counter ,and use percpu_counter_add(&pl->events, -half) to half the counter. There are potential problems: 1.The counter may be negativ

Reducing the bdi proporion calculation period to speed up disk write

2007-12-10 Thread zhejiang
The patch 04fbfdc14e5f48463820d6b9807daa5e9c92c51f implemented bdi per device dirty threshold. It works well. However, the period for proportion calculation may be too large. For 8G memory, the calc_period_shift() will return 19 as the shift. When we switch writing operation between different disk