Subject: Nfs client hangs
To: None <>
From: None <>
List: tech-kern
Date: 10/04/2000 10:56:25
Well, this stuff is getting pretty foggy in my old brain cells (it's embarassing
when you can't remember diddly about something you once wrote:-), but...

Two things come to mind w.r.t. a kernel bug causing this:

1 - There are splXXX() calls in the client timer code that must suspend both
    the software timer (the interrupt that does the timeout callbacks) and
    the network interrupts. At various times during 4.4 development
	splsoftclock() did disable both. If the call currently in the code
    doesn't disable both of the above interrupts, the timer queue can/will
    get corrupted sooner or later.

2 - The NFS client is a lot more sensitive to race conditions in the buffer
    cache code and these usually show up when the server is slow or not
    responding, since a write back of a dirty buffer gets hung waiting on
    the server, or something like that. Whenever there is any possibility
    of a sleep, getbuf() has to go right back up to the top and start over.
    (In 4.4 days, I did at least a couple of rounds of careful hand reading
     of the buffer cache code to find these. A simple trick is just to throw
     a bunch of diagnostic printfs in getbuf() to slow it down, then the
     nasties usually show up pretty quickly.)

Getting the "intr" mounts to work correctly also was mostly careful coding
in the buffer cache, so that all the tsleeps would wake up and return EINTR.
(I can't remember which signals work, but I vaguely recall <ctrl>C isn't
 one of them, because Gnu Emacs loves to use SIGINTR for something?)

Don't know if any of this will help, but good luck with it, rick
ps: In case anyone is curious, I currently have about 90% of a complete
    rewrite of the NFS code done. The rewrite includes V4 and a lot of
    major changes to accomodate it. Unfortunately "real work" has interfered,
    so it may be Christmas before I have anything working. I don't know
    if this will be of use to the NetBSD crowd, since U of Michigan already
    has a V4 out, but I'll put it up anonymous ftp when I think it might
    be useful to others.