Inodes and bufferheads

Vladimir Dergachev (vladimid@seas.upenn.edu)
Thu, 20 Aug 1998 11:00:17 -0400 (EDT)


Ok now that I got the list of bufferheads and inodes from mem_map in a
file I got more questions.
My objective now is to use the information to preload data from disk.
i.e. during boot, right after everything got mounted I want a program to
load all the data that was in memory after the previous boot completed.

Questions:
KHG says that inodes are read from filesystems, which in turn get
their data from buffer. Now if I mmaped (and faulted) a file will it be
both in memory and buffer ? I think it won't since the size of the buffers
is way smaller than the amount of data mmaped. But this brings more
questions -
Is there any limit on the size of the buffer ? My machine has 48megs
ram and it's not exhausted after X starts. If mmaped file were passed thru
buffer the buffer should have expanded.
Assuming that mmaping doesn't bring data thru buffer what happens
if mmaped file (say executable) was open for reading ? will the data be
fetched anew from the disk or will it be retrieved from the inode ?
I think it's the second since both bufferheads and inodes have pointers
to each other.
What if the data was read thru buffer and later requested
to be mmaped ? Would this incur access to disk ? Will the data be
moved from the buffer to the page ?
And - is there an easy way(read kernel function) to find out the blocks
the page contains ? I have the size, the inode and the offset.

I have read KHG and other guides but could find the
information.. I have also looked in the kernel but I haven't puzzled this
out yet.

Any information is very appreciated

Vladimir Dergachev

-
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.altern.org/andrebalsa/doc/lkml-faq.html