lkml.org 
[lkml]   [2010]   [Nov]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 06/13] writeback: bdi write bandwidth estimation
From
Date
On Wed, 2010-11-24 at 20:10 +0800, Wu Fengguang wrote:
> > > + /*
> > > + * When there lots of tasks throttled in balance_dirty_pages(), they
> > > + * will each try to update the bandwidth for the same period, making
> > > + * the bandwidth drift much faster than the desired rate (as in the
> > > + * single dirtier case). So do some rate limiting.
> > > + */
> > > + if (jiffies - bdi->write_bandwidth_update_time < elapsed)
> > > + goto snapshot;
> >
> > Why this goto snapshot and not simply return? This is the second call
> > (bdi_update_bandwidth equivalent).
>
> Good question. The loop inside balance_dirty_pages() normally run only
> once, however wb_writeback() may loop over and over again. If we just
> return here, the condition
>
> (jiffies - bdi->write_bandwidth_update_time < elapsed)
>
> cannot be reset, then future bdi_update_bandwidth() calls in the same
> wb_writeback() loop will never find it OK to update the bandwidth.

But the thing is, you don't want to reset that, it might loop so fast
you'll throttle all of them, if you keep the pre-throttle value you'll
eventually pass, no?

> It does assume no races between CPUs.. We may need some per-cpu based
> estimation.

But that multi-writer race is valid even for the balance_dirty_pages()
call, two or more could interleave on the bw_time and bw_written
variables.


\
 
 \ /
  Last update: 2010-11-24 13:53    [W:0.100 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site