[NTLUG:Discuss] Disk I/O timings.
Richard Cobbe
cobbe at airmail.net
Fri Dec 7 07:56:29 CST 2001
Lo, on Friday, December 7, Steve Baker did write:
>
> > In the absence of a disk cache, the data is loaded when you first access
> > the page, as you describe above. I don't know if Linux caches pages
> > managed by the virtual memory swap system at all, let alone if there's
> > an aggressive read-ahead mechanism, although your timing results suggest
> > that it does and there is.
>
> Excellent - that's the information I needed. Thanks!
Sure thing. (This, by the way, is why you can mmap() a file that's
larger than the available physical memory: the kernel swaps pages in and
out from the file as necessary.)
> > I would think that for a real-time system, you would want much greater
> > control over the caching policy to be able to control situations like
> > this. (Of course, the exact policy choice may not be as important as
> > knowing which choice you've got and what its performance characteristics
> > are.)
>
> Yes - that's true. However, I hardly ever access a file more than once
> so the caching isn't really giving me any benefit - or harming me very
> much (except that it confuses my ability to understand what's going on!)
Right, but such confusion in tight real-time situations can be a killer!
Given your access patterns, would it perhaps be possible to store all of
these data files on a separate partition and mount that partition with
the `sync' option? I'm not completely certain, but it *looks* like this
would disable caching (both read and write) for the filesystem.
Richard
More information about the Discuss
mailing list