Subject: page reuse while accessing files sequentially
To: None <>
From: Frank Kardel <Frank.Kardel@Acrys.COM>
List: tech-kern
Date: 06/04/2004 10:07:41
Hi *,

just a few thoughs with respect to vm page usage, i haven't checked whether
this has been discussed before, if it has: I am sorry.

When writing a large backup data is copied sequentially from a file to 
some place else.
The vm system seemingly keeps these pages around just like any other 
file pages. Thus
there is a constant need for fresh pages and thus all other file pages 
are pushed out in
favor of the pages for the sequential file copy.

Would it make sense to categorize file pages with respect to their usage 
as sequential
access/random access ? Thus the file page sub class could be further 
divided in
sequential pages and random access pages.

A file(vnode) would start out as sequential access vnode until a 
decision can be made, that
access is random. Indications could be:
  - the vnode is mmapped
  - non sequential access
Pages allocated could be marked with the sequential/random information 
of the vnode they
belong to. The sequential page pool could be limited separatly to keep 
it from monopolizing
the file page pool. Even the executables (mmap property) could be 
handled that way without
the need for an executable page class.

A related strategy seems the exist in Solaris 8, where sequential access 
leads to a FIFO
replacement strategy. This might be dangerous though, as we did have 
once a state where
our java vm was seemingly on the FIFO replacement strategy making work 
very slow :-( .
This effect should be avoided.

Any comments ?