lkml.org 
[lkml]   [1999]   [Jul]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectFile hinting, and a new file flag?
Date
The recent discussion about hinting and speculative execution
brought to mind something I've long wondered about: Why is
there no way to specify on a file open that you will be reading
an entire file sequentially? If the OS knew about the caller's
intentions at open time, it could check the available memory and
the file's size, and if the ratio were high enough, it could read
the whole file into a buffer, or even run a background thread to
do read aheads.

This would only apply to read-only access of existing files, obviously,
and lacking enough memory, the OS would just ignore the flag an
do a normal open. Given how often software processes a file in
exactly this way, it seems like an opportunity to let the programmer
help the OS perform an optimization.

I've tried to find an example of this being tried in an OS, but come up
empty. It's such a simple idea that I have to believe it's been looked at
before.


Lou



-
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/

\
 
 \ /
  Last update: 2005-03-22 13:52    [W:0.058 / U:1.724 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site