RE: Speeding up swap

David Schwartz (davids@webmaster.com)
Sat, 23 Oct 1999 13:12:22 -0700


> Into the same direction goes the following question: How would I
> advise the system that I am going to scan the following
> multi-megabyte file only once, and that the contents of this
> file need not enter any disk cache, because that would be
> useless? Imagine a numerical algorithm sequentially scanning a
> very large file for transformation or a video player streaming
> from disk or something like that.

How would the kernel know when you had accessed it 'once' without making
some odd assumptions about such things as block size?

For example, to some people this might be considered accessing a file
"once":

char buf[256];
int f=open("myfile",O_RDONLY);
while(read(f,buf,10)>0)
{
// some junk
}

But unless the page size just happens to be 10, each page is going to be
read more than once. (Ouch!) So pages are still going to have to be cached,
otherwise each 'read' would result in a disk access.

So, the question really is, exactly what do you _really_ want?

DS

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