Subject: Re: RAW access to files
To: Chuck Silvers <>
From: Thor Lancelot Simon <>
List: tech-kern
Date: 12/12/2001 09:34:51
On Tue, Dec 11, 2001 at 11:58:42PM -0800, Chuck Silvers wrote:
> for applications that do large runs of sequential i/o, the same logic
> applies as well, if the application isn't going to access the data multiple
> times and it uses i/os of at least 64k.  read ahead doesn't gain you all
> that much when you're doing large i/os, especially on modern disks that
> do read ahead into the cache in the disk.  in this case there's basically
> no difference to the disk driver between doing the i/o to filesystem cache
> pages vs. doing the i/o straight to the application, and doing it direct saves
> a memory-to-memory copy.  for large i/os, we can also use UVM loaning to
> avoid the memory-to-memory copy in some cases, but in cases where loaning
> is impossible (or undesirable for whatever reason) then direct i/o
> would also be valuable.

I've always thought that mmap of raw disk devices was a nice solution to
this problem.  It saves system-call overhead as well as the memory-to-memory
copy, just so long as you don't need more than 32 bits worth of data.