[NTLUG:Discuss] Disk I/O timings.

Steve Baker sjbaker1 at airmail.net
Wed Dec 5 18:16:06 CST 2001


Bug Hunter wrote:
> 
>   You are correct in that the problem is the linux file caching.
> 
>   All available memory is used for file cache.
> 
>   Hard drives now have RAM caching, and the size of the cache is usually
> reported by the drive at BIOS boot time, and is available via dmesg.  It
> is typically a track-at-a-time cache, which can give very good results for
> a un-fragmented drive.
> 
>   What are you after?  Worst case?

I want to know *WHEN* the kernel transfers the data from the disk drive
(or the disk drives cache) into the cache in main memory.  Does it do it
when I do the 'open' or when I 'mmap' the file - or when I first try to
access the mmap'ed array to read the data?  ...or perhaps at some other time?

I could imagine either strategy being seen as 'useful' by the kernel/file-sys
guys.

When you open a file for reading, it's pretty likely that you'll actually
want to read from it soon after - so it would make sense for the kernel to
start loading it from disk "just in case" if the disk drive is otherwise
idle.

OTOH, they might say "well, it's a waste of cache to load a file that *might*
never be read" - and hence not bother to load it until I actually read
some data out of that mmap'ed array (thereby causing a page fault and triggering
the actual read).

...or it might be something still cleverer than that.

----------------------------- Steve Baker -------------------------------
Mail : <sjbaker1 at airmail.net>   WorkMail: <sjbaker at link.com>
URLs : http://www.sjbaker.org
       http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net
       http://prettypoly.sf.net http://freeglut.sf.net
       http://toobular.sf.net   http://lodestone.sf.net




More information about the Discuss mailing list