[haiku-development] Re: Haiku self-hosting.

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 02 Apr 2008 10:17:15 +0200 CEST

"Stephan Assmus" <superstippi@xxxxxx> wrote:
> the implementation of the writing back is not yet ideal. There is a 
> TODO in the code,
> it boils down to the fact that Haiku doesn't have an I/O scheduler 
> yet.

Absolutely.

> Currently, Haiku writes back 32 KB of file data every three seconds, 
> *if* there is no
> memory pressure (in case of pressure it writes much faster). This 
> means that if you
> write a 500 MB file, but have plenty of memory left, Haiku will use 
> about 3 hours 20
> minutes to write all the contents of the file to disk.

It actually writes back 128 KB every three seconds of file cache data, 
and up to 128 KB of block cache data every two seconds. If you have a 
lot of disk activity, the block cache is synced periodically, as is the 
HD cache.

>  Obviously, this is not ideal by any measure.

Definitely not :-)

> The reason why Haiku currently does not write the files as soon as 
> possible, is that it
> should not interfere with other work going on. That would defeat the 
> purpose of caching.
> Without an I/O scheduler, Haiku cannot tell whether the system is 
> busy or not. I hope this
> interpretation is accurate, but I might be off.

That's one reason. The other is that it writes back the pages in random 
order which is *very* slow, and would considerably slow down HD access 
if it would write more pages back.
The I/O scheduler could accept a lot more pages at once (and other 
requests), as it knows which requests are more important than others, 
and also orders the requests according to the current position of the 
HD's head - this allows the VM to write back pages aggressively without 
causing a slow down and random head movement.

> In any case, you are obviously right that this is an issue, but it 
> does not require quite as
> wordy emails to bring the point across... :-).

As I know this babbling from private mails, I must admit I didn't even 
finish reading the mail; that tone is just not bearable for me, 
especially as I know that explanations are futile.

Bye,
   Axel.


Other related posts: