lkml.org 
[lkml]   [2011]   [Aug]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5/5] writeback: IO-less balance_dirty_pages()
On Sat, Aug 06, 2011 at 04:44:52PM +0800, Wu Fengguang wrote:

[..]
> - trace_balance_dirty_start(bdi);
> - if (bdi_nr_reclaimable > task_bdi_thresh) {
> - pages_written += writeback_inodes_wb(&bdi->wb,
> - write_chunk);
> - trace_balance_dirty_written(bdi, pages_written);
> - if (pages_written >= write_chunk)
> - break; /* We've done our duty */
> + if (unlikely(!writeback_in_progress(bdi)))
> + bdi_start_background_writeback(bdi);
> +
> + base_bw = bdi->dirty_ratelimit;
> + bw = bdi_position_ratio(bdi, dirty_thresh, nr_dirty,
> + bdi_thresh, bdi_dirty);

For the sake of consistency of usage of varibale naming how about using

pos_ratio = bdi_position_ratio()?

> + if (unlikely(bw == 0)) {
> + pause = MAX_PAUSE;
> + goto pause;
> }
> + bw = (u64)base_bw * bw >> BANDWIDTH_CALC_SHIFT;

So far bw had pos_ratio as value now it will be replaced with actual
bandwidth as value. It makes code confusing. So using pos_ratio will
help.

bw = (u64)base_bw * pos_ratio >> BANDWIDTH_CALC_SHIFT;

Thanks
Vivek


\
 
 \ /
  Last update: 2011-08-09 20:19    [W:0.500 / U:0.968 seconds]
©2003-2014 Jasper Spaans. Advertise on this site