If the patch were to be modified to include the following, you would not
have an issue with it:
1) Pages should not be candidates for dropping if an open file has
a seek offset pointing to an earlier page unless the seek offset
is many pages away. (I'm not sure what the best way of defining
'many' is... free memory? disk access times? experimentation?)
2) Pages should not be candidates for dropping if the pages belong
to the first few pages of a file. (First = 2? 4? 8?) The theory
being, that somebody could begin reading the file again from the
beginning.
With this in mind, dynamic detection becomes a lot easier and less
error prone. The simplest way of detecting a file that would benefit
from having pages dropped is to keep a flag that indicates whether the
file was *ever* read non-sequentially. If a file was never read
non-sequentially, pages that are not at the beginning of the file, and
pages that are earlier than all seek points for the file, or that are
many pages later than all earlier seek points for the file may be
safely dropped. In fact, I am surprised this is not implemented
already. :-)
mark
-- mark@mielke.cc/markm@ncf.ca/markm@nortelnetworks.com __________________________ . . _ ._ . . .__ . . ._. .__ . . . .__ | Neighbourhood Coder |\/| |_| |_| |/ |_ |\/| | |_ | |/ |_ | | | | | | \ | \ |__ . | | .|. |__ |__ | \ |__ | Ottawa, Ontario, CanadaOne ring to rule them all, one ring to find them, one ring to bring them all and in the darkness bind them...
- 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/