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

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


Helge Hafting wrote:

> Erik Hensema wrote:
> [...]
>
>> Helge Hafting already pointed out that writing out the data earlier
>> isn't
>> desirable. The problem isn't in the waiting: the problem is in the
>> writing.
>> I think the current kernel tries to write too much data too fast when
>> there's absolutely no reason to do so. It should probably gently
>> write out
>> small amounts of data until there is a more pressing need for memory.
>>
> I don't think the problem is "writing a large chunk", rather that this
> chunk is scheduled for writing a bit too late. Memory is filling up
> and the process producing data us throttled while waiting for
> the write to free up pages. Then the "huge chunk" of pages is released,
> and memory is allowed to fill up for too long again.
>
> Seem to me the correct solution is to start writing out
> things long before memory gets so full that we need to
> throttle the producer.

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.

-
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/