[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1315320726.14232.11.camel@twins>
Date: Tue, 06 Sep 2011 16:52:06 +0200
From: Peter Zijlstra <a.p.zijlstra@...llo.nl>
To: Wu Fengguang <fengguang.wu@...el.com>
Cc: linux-fsdevel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
Jan Kara <jack@...e.cz>, Christoph Hellwig <hch@....de>,
Dave Chinner <david@...morbit.com>,
Greg Thelen <gthelen@...gle.com>,
Minchan Kim <minchan.kim@...il.com>,
Vivek Goyal <vgoyal@...hat.com>,
Andrea Righi <arighi@...eler.com>,
linux-mm <linux-mm@...ck.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 13/18] writeback: limit max dirty pause time
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?
> +}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists