Subject: Re: Limiting disk I/O?
To: None <tech-kern@NetBSD.org>
From: Matthias Scheler <tron@zhadum.org.uk>
List: tech-kern
Date: 12/04/2007 14:06:40
On Mon, Dec 03, 2007 at 09:25:12AM +0100, Ignatios Souvatzis wrote:
> > except what you really need is more like:
> > 
> > while (something_to_be_flushed) {
> >   if (systat_disk_%busy >= 90) {
> > 	temporarily_let_new_io_bypass_softdep()
> >   }
> >   else
> >     turn_off_bypass()
> >   flush_some_data();
> > };
> 
> I don't know the details of softdep, but the idea is to only make 
> i/o with some ordering constraints, such that a certain state of 
> the disk is always guaranteed, right?
> 
> Now guess what happens when you temporarily bypass softdep's ordering.

Bad things(TM)

Can the flush be stopped and resume later? If I understood correctly the
problem is that when the system flushes it flushes everything. So the
loop should look like this perhaps:

void
Flush()
{
	while (something_to_be_flushed()) {
		flush_a_bit();
		if (more_io_waiting() and have_some_free_buffer_space())
			return;
	}
}


	Kind regards

-- 
Matthias Scheler                                  http://zhadum.org.uk/