All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Kennedy <richard@rsk.demon.co.uk>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Wu Fengguang <fengguang.wu@intel.com>,
	lkml <linux-kernel@vger.kernel.org>
Subject: bdi_threshold slow to reach steady state
Date: Wed, 14 Oct 2009 12:09:45 +0100	[thread overview]
Message-ID: <1255518586.2360.78.camel@castor> (raw)

Hi Peter,

I've been running simple tests that uses fio to write 2Gb & reading the
bdi dirty threshold once a second from debugfs. 

The graph of bdi dirty threshold is nice and smooth but takes a long
time to reach a steady state, 60 seconds or more. (run on 2.6.32-rc4)

By eye it seems as though a first-order control system is a good model
for its behavior, so it approximates to 1-e^(-t/T). It just seems too
heavily damped ( at least on my machine).

For fun, I changed calc_period_shift to
	return ilog2(dirty_total - 1) - 2;

and it now reaches a steady state much quicker, around 4-5 seconds.

Tests that write to 2 disks at the same time show no significant
performance differences but are much more consistent, i.e. the standard
deviation is lower across multiple runs.

I have noticed that the first test run on a freshly booted machine is
always the slowest of any sequence of tests, but this change to
calc_period_shift greatly reduces this effect. 

So I wondered how you chose these values? and are there any other tests
that are useful to explore this?

I know that my machine is getting a bit old now, it's AMDX2 & only has
sata 150 drives, so I'm not suggesting that this change is going to be
correct for all machines but maybe we can set a better default? or take
more factors in to account other than just memory size. 

BTW why is it ilog2(dirty_total -1) -- what does the -1 do?

regards
Richard



             reply	other threads:[~2009-10-14 11:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-14 11:09 Richard Kennedy [this message]
2009-10-14 11:37 ` bdi_threshold slow to reach steady state Peter Zijlstra
2009-10-14 13:55   ` Richard Kennedy
2009-10-14 14:04     ` Peter Zijlstra
2009-10-15  9:22       ` Richard Kennedy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1255518586.2360.78.camel@castor \
    --to=richard@rsk.demon.co.uk \
    --cc=a.p.zijlstra@chello.nl \
    --cc=fengguang.wu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.