Re: [PATCH 16/35] writeback: increase min pause time on concurrent dirtiers

From: Valdis . Kletnieks
Date: Mon Dec 13 2010 - 13:24:56 EST


On Mon, 13 Dec 2010 22:47:02 +0800, Wu Fengguang said:
> Target for >60ms pause time when there are 100+ heavy dirtiers per bdi.
> (will average around 100ms given 200ms max pause time)

> --- linux-next.orig/mm/page-writeback.c 2010-12-13 21:46:16.000000000 +0800
> +++ linux-next/mm/page-writeback.c 2010-12-13 21:46:16.000000000 +0800
> @@ -659,6 +659,27 @@ static unsigned long max_pause(unsigned
> }
>
> /*
> + * Scale up pause time for concurrent dirtiers in order to reduce CPU overheads.
> + * But ensure reasonably large [min_pause, max_pause] range size, so that
> + * nr_dirtied_pause (and hence future pause time) can stay reasonably stable.
> + */
> +static unsigned long min_pause(struct backing_dev_info *bdi,
> + unsigned long max)
> +{
> + unsigned long hi = ilog2(bdi->write_bandwidth);
> + unsigned long lo = ilog2(bdi->throttle_bandwidth);
> + unsigned long t;
> +
> + if (lo >= hi)
> + return 1;
> +
> + /* (N * 10ms) on 2^N concurrent tasks */
> + t = (hi - lo) * (10 * HZ) / 1024;

Either I need more caffeine, or the comment doesn't match the code
if HZ != 1000?

Attachment: pgp00000.pgp
Description: PGP signature