*BSD News Article 90479


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!news.wildstar.net!serv.hinet.net!news.uoregon.edu!arclight.uoregon.edu!su-news-hub1.bbnplanet.com!news.bbnplanet.com!cliffs.rs.itd.umich.edu!cloudbreak.rs.itd.umich.edu!newsrelay.iastate.edu!news.iastate.edu!idea.exnet.iastate.edu!flipk
From: flipk@idea.exnet.iastate.edu (Phillip F Knaack)
Newsgroups: comp.os.linux.misc,comp.os.linux.networking,comp.os.linux.setup,comp.unix.bsd.bsdi.misc,comp.unix.bsd.misc
Subject: Re: User-space file systems. (Re: Linux vs BSD)
Date: 6 Mar 1997 17:39:59 GMT
Organization: Iowa State University, Ames, Iowa, USA
Lines: 42
Message-ID: <5fmvhf$8dh$1@news.iastate.edu>
References: <5e6qd5$ivq@cynic.portal.ca> <5fj9q4$s0i@pulp.ucs.ualberta.ca> <5fjek4$gtm@cynic.portal.ca> <5fk1t1$3mq@web.nmti.com> <5fkk34$182@cynic.portal.ca>
NNTP-Posting-Host: idea.exnet.iastate.edu
X-Newsreader: NN version 6.5.1.1 (NOV)
Xref: euryale.cc.adfa.oz.au comp.os.linux.misc:163064 comp.os.linux.networking:71032 comp.os.linux.setup:101234 comp.unix.bsd.bsdi.misc:6228 comp.unix.bsd.misc:2733

cjs@cynic.portal.ca (Curt Sampson) writes:

>In article <5fk1t1$3mq@web.nmti.com>, Peter da Silva <peter@nmti.com> wrote:

>>But, Curt, reading a *local* disk block makes two kernel transitions anyway.

>I don't understand this. Reading a local disk block is done in the
>kernel. If the NFS server daemon is in the kernel, the request to
>read comes from the kernel, the read is done in the kernel, and
>the data is sent back by the kernel. Where does userland get involved
>at all?

	Correct me if I'm wrong, but isn't it the userland programs that 
actually *do* reading and writing?  Or do all of your processes run as
kernel threads?  (That wasn't a flame; it was a rhetorical question. :)

	Say you have a user process reading a large file.  With NFS in the
kernel, that data only has to cross the kernel/user boundary once (a
copyout() for the read system call).  If you're using a user-space NFS
filesystem, that data must cross at least twice (once to get from user-space
NFS client to kernel VFS layer, and once back again into the process reading
it).

	As you get into larger and larger files and data transfers, 
copyin() and copyout() get very very expensive.

>I'm perhaps a little more neutral on this issue that I make myself
>out to be, though. While I certainly wouldn't re-write the BSD NFS
>server to run as a userland daemon, I would seriously consider
>writing one for userland rather than kernel if I were starting from
>scratch.

	Yes, development is MUCH easier in userspace. I know this from
experience. :)

Cheers,
Phil
--
   Interoperation with matter-transporters using polar coordinate
   systems is discouraged, due to round-off and other algorithmic errors
   in certain ubiquitous floating-point implementations, leading to
   results which are best discreetly described as "disappointing." --RFC 1437