Coda File System

Re: Hacking coda kernel module to read file data from user process

From: Jan Harkes <jaharkes_at_cs.cmu.edu>
Date: Sat, 14 Jul 2001 22:00:24 -0400
On Fri, Jul 13, 2001 at 03:24:35PM -0700, Glenn Serre wrote:
> Good afternoon, 
> 
> Has anyone successfully modified the coda linux kernel module (and
> client process) to read file data from the client process (modified
> Venus) instead of reading from local disk?  

Modify/write a userspace NFS daemon.

> I am about to attempt this modification (so I can implement a user fs
> without having to copy entire files), and would appreciate any tips or
> pointers to similar work. 

No need for two NFS clients in the Linux kernel. In fact Coda's semantic
model simplifies a lot of things. Every upcall takes at least 2 context
switches, so either your solution will become incredibly slow or as
complex as the existing NFS client/daemon code.

It is trivial to not use the container file inode and provide
i_mapping->a_ops->readpage/writepage implementations, but very hard
to get the right balance between allowing the kernel to cache these
pages and keeping these cached pages consistent between both kernel and
userspace whenever their content changes. 

If you don't force the pages out, the kernel will always return stale
data and you won't see the writes, until memory pressure kicks in. If
you flush/purge/invalidate them quick enough to get usable consistency
you pay heavily due to a pagefault/upcall on every access a page.

Especially concurrent directory updates are deadly in the details
when it comes to consistency (i.e. not breaking current readdir calls
while adding/removing names).

Pointers? This page links to pretty much all userfs implementations
that I know of,
    http://www.goop.org/~jeremy/userfs/

Jan
Received on 2001-07-14 22:00:57