[comp.protocols.nfs] How many clntudp_create

yozzo@wam.umd.edu (Ralph Yozzo) (03/21/90)

 How many clntudp_create() are there in an NFS client? 

I am wondering if this is correct?
  
An NFS client should create a UDP socket for every
biod that it is running.

And each biod will call cntludp_create() for 
every NFS server that the client mounts.
 

This mean that if I am running 4 biod's 
and I have 2 file systems mounted, 
I should have 
   4 UDP sockets
  and 
   4*2 = 8 clntudp_create()'s
 
Ralph Yozzo (yozzo@ibm.com)

liam@cs.qmw.ac.uk (William Roberts) (03/23/90)

The nfsd command opens a single UDP socket, then forks a lot to
make process table entries, then makes a system call to pass
the socket to the kernel routines which take over from there.

The biod processes just fork to make process table slots and
then execute a different system call. This does almost
everything that _exit() does (frees memory etc) but leaves the
process table entries available for associating with read/write
requests.

Entirely separately, whenever the kernel needs to do an rpc to
a remote server, it does an clget to find a free "client
structure" from a table whose size is fixed at compile time.
The free client structure is marked as "in use" and then a
clntudp_create() is called to make a socket if this client
structure has not been used before.

The biod daemons is sitting idle in a queue until the kernel
NFS code notices that the read/write request is flagged as
ASYNCH, in which case an attempt will be made to get a biod to
wait for the I/O rather than the current process. If there
aren't any biods then some other lucky process gets to do the
waiting! You can run without biods - it all still works OK.



To summarise: the number of clntudp_create() calls is limited
by the size of the array of client structures, and has nothing
to do with the number of nfsds, biods or anything else.
-- 

William Roberts                 ARPA: liam@cs.qmw.ac.uk
Queen Mary & Westfield College  UUCP: liam@qmw-cs.UUCP
Mile End Road                   AppleLink: UK0087
LONDON, E1 4NS, UK              Tel:  01-975 5250 (Fax: 01-980 6533)