lkml.org 
[lkml]   [2011]   [Sep]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 13/18] writeback: limit max dirty pause time
From
Date
On Sun, 2011-09-04 at 09:53 +0800, Wu Fengguang wrote:

> +static unsigned long bdi_max_pause(struct backing_dev_info *bdi,
> + unsigned long bdi_dirty)
> +{
> + unsigned long hi = ilog2(bdi->write_bandwidth);
> + unsigned long lo = ilog2(bdi->dirty_ratelimit);
> + unsigned long t;
> +
> + /* target for ~10ms pause on 1-dd case */
> + t = HZ / 50;

1k/50 usually ends up being 20 something

> + /*
> + * Scale up pause time for concurrent dirtiers in order to reduce CPU
> + * overheads.
> + *
> + * (N * 20ms) on 2^N concurrent tasks.
> + */
> + if (hi > lo)
> + t += (hi - lo) * (20 * HZ) / 1024;
> +
> + /*
> + * Limit pause time for small memory systems. If sleeping for too long
> + * time, a small pool of dirty/writeback pages may go empty and disk go
> + * idle.
> + *
> + * 1ms for every 1MB; may further consider bdi bandwidth.
> + */
> + if (bdi_dirty)
> + t = min(t, bdi_dirty >> (30 - PAGE_CACHE_SHIFT - ilog2(HZ)));

Yeah, I would add the bdi->avg_write_bandwidth term in there, 1g/s as an
avg bandwidth is just too wrong..


> +
> + /*
> + * The pause time will be settled within range (max_pause/4, max_pause).
> + * Apply a minimal value of 4 to get a non-zero max_pause/4.
> + */
> + return clamp_val(t, 4, MAX_PAUSE);

So you limit to 50ms min? That still seems fairly large. Is that because
your min sleep granularity might be something like 10ms since you're
using jiffies?

> +}




\
 
 \ /
  Last update: 2011-09-06 16:55    [W:0.199 / U:0.704 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site