cvs commit: src/sys/kern vfs_subr.c

Jeff Roberson jroberson at chesapeake.net
Mon Apr 4 14:37:18 PDT 2005


On Mon, 4 Apr 2005, Alfred Perlstein wrote:

> * Jeff Roberson <jeff at FreeBSD.org> [050404 04:43] wrote:
> > jeff        2005-04-04 11:43:44 UTC
> >
> >   FreeBSD src repository
> >
> >   Modified files:
> >     sys/kern             vfs_subr.c
> >   Log:
> >    - Instead of waiting forever to get a vnode in getnewvnode() wait for
> >      one to become available for one second and then return ENFILE.  We
> >      can run out of vnodes, and there must be a hard limit because without
> >      one we can quickly run out of KVA on x86.  Presently the system can
> >      deadlock if there are maxvnodes directories in the namecache.  The
> >      original 4.x BSD behavior was to return ENFILE if we reached the max,
> >      but 4.x BSD did not have the vnlru proc so it was less profitable to
> >      wait.
>
> This sounds really bad, can't a callback be made into the
> namecache first to purge unused records before doing this?
>
> Or is there already some sort of facility that already does
> this?

Well, the vnlruproc will try to vgone vnodes when we reach 9/10th of our
limit.  However, it skips directories that have valid children.  Perhaps
it shouldn't.  I think that we need to be able to fail from getnewvnode(),
which we weren't doing before.  We should also try to find more ways to
deal with resource starvation to make this failure less likely, but there
will always be cases where it must happen.


>
> --
> - Alfred Perlstein
> - Research Engineering Development Inc.
> - email: bright at mu.org cell: 408-480-4684
>


More information about the cvs-src mailing list