[haiku-development] Re: BFS and write back problems

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Thu, 03 Apr 2008 14:27:33 +0200 CEST

Marcus Overhagen <marcusoverhagen@xxxxxxxx> wrote:
[calling sync() in apps]
> > Actually, I think something like that is absolutely justified. It's 
> > the 
> > users email after all. I would go as far as add such behaviour to 
> > text 
> > editors in general. ;-)
> I think that we need to be very careful with this. Applications 
> shouldn't ever need to flush or sync. The kernel must handle this
> automatically.

"Shouldn't ever" definitely depends on the situation; a database app 
might need to use it to be able to implement journaling.

> The kernel really needs to flush dirty data to the disc once the
> system is "idle" after a disk operation (to be defined) for some
> time (i.e. 500ms for removeable media, 3000 ms for permanent 
> storage).

For now, my plan is to throw everything at the I/O scheduler more or 
less without any delay. This kind of I/O will have a very low priority, 
and will thus only be carried out if there is nothing else to do, or if 
the current head placement allows for fulfilling some of them in the 
current batch.

> There is an issue with spinning down of harddisks. Usually I like my
> harddisks to spin down after 20 minutes, but I read somewhere that
> Linux had issues with that, because something is permanently writing
> to the disk. In windows I observed something similar, windows writes
> small data to disk every 20 seconds (or similar), but hdd spin down
> works anyway.

While BFS does not maintain the access time, we will run into similar 
problems. I thought about delaying spinning up again when there is an 
actual reason to do so other than to just write back some inflight 
data. There could also be a special laptop mode which tries to be even 
more conservative. We'll see, once all needed components are in place.

> I also think kernel should not execute the IDE/ATA/SCSI synchronize
> cache command at regular intervals (unless the system is shut down), 
> because that usually stalls the harddisk for a few seconds.

I'm afraid that is not possible, as this would render all journaling 
mechanisms useless.

Bye,
   Axel.


Other related posts: