Subject: Re: Limiting disk I/O?
To: Andrew Doran <ad@netbsd.org>
From: Jukka Marin <jmarin@embedtronics.fi>
List: netbsd-users
Date: 12/02/2007 18:34:40
On Sun, Dec 02, 2007 at 04:26:03PM +0000, Andrew Doran wrote:
> It should not be that slow but softdep has done its job here (24016io vs
> 536917io). Untarring pkgsrc in 14 seconds is a bit of an illusion, because
> all the updates have just been dumped into memory and are not on the disk.

Yes, but what's bothering me is that when softdep starts to flush everything
to physical disk, the machine may be unusable for 60 to 120 seconds (with all
disk I/O being blocked).

> As it stands with the softdep code there can be maybe 1/2 million of those
> sitting around which naturally causes problems when it comes time to flush
> them to disk. Really what it needs is a better way to pace threads that are
> making too many updates in quick succession. At the moment it is all global.

If I could limit the softdep flush to always keep some 10% of disk I/O
available, the machine would not stop completely during the flush operation.

while (something_to_be_flushed) {
  if (systat_disk_%busy >= 90) {
    sleep_before_next_flush(a_bit);
  }
  flush_some_data();
};

  -jm