Put a timeout on -ve name cache entries in NFS

Rick Macklem rmacklem at uoguelph.ca
Fri Oct 23 14:43:33 UTC 2009



On Sat, 24 Oct 2009, Bruce Evans wrote:

> On Thu, 22 Oct 2009, Rick Macklem wrote:
>
>> On Thu, 22 Oct 2009, Bruce Evans wrote:
>>> One reason that I never committed my port of NetBSD's implementation of
>>> negative cache entries for nfs is that I thought the timeout should be
>>> a mount option but I didn't want to deal with the portability problems
>>> from that.
>>> 
>> Just to clarify. Are you saying that, given no other system has such
>> a mount option, you think the sysctl variable is an ok solution or
>> that you think it should be a mount option and not a sysctl variable?
>
> No; I think it should be a mount option.
>
Ok, so then what were your concerns w.r.t "portability problems"?
(It's not that much work to make it a mount option and since it looks
like the patch will be delayed until after 8.0 releases, I/or John
can make it a mount option but I didn't understand what you meant
by "portability options".)

[good stuff w.r.t. which is harder, deleted for brevity]
>
> My version actually just uses a hackish sysctl vfs.nfs.negcache (default:
> enabled) to enable the negative name cache.  I don't have any timeout
> control for it.
>
Yea, I saw it mainly as a way to disable -ve caching too. It just
happened that the sysctl variable could specify the timeout as well
as disable it (if set == 0). When it comes to a mount option, an
enable/disable flag is probably easier, but then there might be a
debate along the lines of "An option shouldn't be enabled by default...",
so I'm temped to stick with a setable timeout.

Basically the current code has an "infinite" timeout and no way of
disabling it, so it seemed to me that some sort of optional
timeout/disable would be useful, so I suggested that to John.

If no-one else weighs in on the other side, I head in the "mount option"
direction, rick



More information about the freebsd-arch mailing list