Hi Everybody,

I want to implement a file cache on Linux for PVFS2. I want to know
what my options are and what are the different ways in which I can
implement the file cache:

For instance, if I have a set of 4 processes and I want to intercept
the open(), read(), write() and close() system calls made by these 4
different PIDs and redirect those calls through my caching mechanism.

 1. Could I do it in a user level library, for instance, if I write a
library interposer to intercept the system calls and then allocate a
chunk of memory. Will that be able to serve as my cache?
 2. Could I mmap a file into memory that will serve as my cache?
 3. Will applications have problems sharing this data since it is
implemented as a library and will run as a part of the user code, or
could I mmap it to a shared memory so that it will avoid such data
sharing problems between applications?
 4. Is this "memory that I allocate/file that I mmap()" likely to be
paged out to disk (since it is a file cache, I will be using a big
chunk of memory, say 256MB)? If so, will I see any benefits of caching
the file?
 5. What will be the overhead of such a user level implementation
(trapping system calls)?
 6. If it can be done using a user level library, could I also use
something like ptrace to selectively trap certain calls from chosen
processes?

 7. If a user level implementation of a file cache is not possible,
then I will have to implement a file cache in the kernel. I personally
do not have any experience in kernel programming and would like to ask
you'll what are the different ways in which I can implement a file
cache in Linux?
 8. I came across a kmem_cache_create() function. What is that suitable for?
 9. If not, will I have to trap system calls using the procedure
mentioned at: 
http://85.147.245.113/mirrorbooks/networksecuritytools/0596007949/networkst-CHP-7-SECT-2.html
and then use some special API's to build a file cache?
10. Once I make the file cache in the kernel, is it likely to get
paged out to disk?


I believe that many people on this forum have previously worked on
file caching and have knowledge and experience in this domain. Are
there any open source file caching projects in PVFS2 that I could
experiment with/get access to?
I would really appreciate any help from you.

Thanks and Regards,
Christina.
_______________________________________________
Pvfs2-developers mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers

Reply via email to