[OpenAFS-devel] afsd on FreeBSD 8.1

Benjamin Kaduk kaduk@MIT.EDU
Sun, 16 Jan 2011 21:47:50 -0500 (EST)


On Sun, 16 Jan 2011, Toby Burress wrote:

> I'm playing around with getting the client into a usable state on FreeBSD
> 8.1, and on that platform if you try to use the disk-based cache, it hangs.
>
> It turns out that this hang is in vn_rdwr() (from
> /usr/src/sys/kern/vfs_vops.c).  I've found two ways around this.
> The first way is to change src/afs/FBSD/osi_machdep.h to change the
> definition of gop_rdwr() to call vn_rdwr_inchunks() instead.
>
> The other way is to lock the vnode with vn_lock(), and then pass the
> IO_NODELOCKED flag to gop_rdwr().
>
> My questions are: (a) which of these fixes, if either, is acceptable,
> or is there a better way, (b) is -memcache better for fbsd anyway, and
> (c) should I just submit this to gerrit?

I believe that the IO_NODELOCKED flag is the better of the two options you 
have listed.  But,
(b) you should be using memcache on fbsd at the moment, as that's where 
the developer attention has been focused.
(c) I expect there to be a bunch more changes needed to get an actually 
useful disk cache on fbsd, so probably hold off for now.

If you're planning to do work on improving the disk cache, I strongly 
recommend compiling a kernel with WITNESS and DEBUG_VFS_LOCKS (and maybe 
some more debugging options such as INVARIANTS, etc.) -- what you saw as a 
hang is detected by WITNESS and panics accordingly.  Obviously, if you're 
doing kernel filesystem development, don't use a machine that you need to 
be reliably up; I'd also recommend disabling background fsck.

-Ben Kaduk