There's an easy answer that should work well on both servers and laptops,
that goes something like this: when memory pressure has been brought to 0, if
there there is plenty of disk bandwidth available, continue writeout for a
while and clean some extra pages. In other words, any episode of pageouts
is followed immediately by a short episode of preemptive cleaning.
This gives both the preemptive cleaning we want in order to respond to the
next surge, and lets the laptop disk spin down. The definition of 'for a
while' and 'plenty of disk bandwidth' can be tuned, but I don't think either
is particularly critical.
As a side note, the good old multisecond delay before bdflush kicks in
doesn't really make a lot of sense - when bandwidth is available the
filesystem-initiated writeouts should happen right away.
It's not necessary or desirable to write out more dirty pages after the
machine has been idle for a while, if only because the longer it's idle the
less the 'surge protection' matters in terms of average throughput.
-- Daniel - 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/