lkml.org 
[lkml]   [2011]   [Aug]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 3/5] writeback: dirty rate control
From
Date
On Sat, 2011-08-06 at 16:44 +0800, Wu Fengguang wrote:

> + pos_bw = bw * pos_ratio >> BANDWIDTH_CALC_SHIFT;
> + pos_bw++; /* this avoids bdi->dirty_ratelimit get stuck in 0 */
> +

> + pos_ratio *= bdi->avg_write_bandwidth;
> + do_div(pos_ratio, dirty_bw | 1);
> + ref_bw = bw * pos_ratio >> BANDWIDTH_CALC_SHIFT;

when written out that results in:

bw * pos_ratio * bdi->avg_write_bandwidth
ref_bw = -----------------------------------------
dirty_bw

which would suggest you write it like:

ref_bw = div_u64((u64)pos_bw * bdi->avg_write_bandwidth, dirty_bw | 1);

since pos_bw is already bw * pos_ratio per the above.

Or am I missing something?


\
 
 \ /
  Last update: 2011-08-09 19:05    [W:0.327 / U:0.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site