Re: Delaying writes to disk when there's no need

Nick Piggin (piggin@cyberone.com.au)
Tue, 01 Apr 2003 08:35:06 +1000


Chris Friesen wrote:

> Nick Piggin wrote:
>
>> I haven't thought about this much, but it seems to me that
>> doing writeout whenever the disk would otherwise be idle
>> (and we have dirty memory to write out) would be a good
>> solution.
>
>
> The whole argument about waiting though is that there may be another
> write coming to the same place, in which case you could save the cost
> of the first write because it didn't have to be written.
>
> Writing to disk isn't free, even if the disk would otherwise be idle.
> You have the cost of the setup as well as the memory and pci bus
> traffic. You may have disk bandwidth available but be already maxing
> out the PCI bus, in which case your "free" disk write takes I/O away
> from other things.

Only if the memory gets dirtied again, otherwise the earlier the better.
If the
memory does get written to again before the writeout timeout then yeah
its used
some cpu, memory, pci, etc that it didn't have to.

>
>
> Ultimately its all a tradeoff. Do you write now, or do you hold off
> and hope that you can throw away some of the writes because new stuff
> will home in to overwrite them?

Yes it is a tradeoff. Having an idle disk gives more weight to "write now".

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/