an easy (?) question on namecache sizing

Kirk McKusick mckusick at mckusick.com
Fri Nov 6 19:09:37 UTC 2015


> Date: Fri, 6 Nov 2015 20:50:53 +0200
> From: Konstantin Belousov <kostikbel at gmail.com>
> To: Kirk McKusick <mckusick at mckusick.com>
> Subject: Re: an easy (?) question on namecache sizing
> Cc: fs at freebsd.org
> 
>>> I think wantfreevnodes should be set before the cache size changes when
>>> desiredvnodes is decreased, but kept at the place in your patch for the
>>> increasing case.
>> 
>> What is the benefit of waiting until after the caches are resized
>> for setting wantfreevnodes when desiredvnodes is increasing? It
>> seems like it just complicates the code to conditionally do the
>> update in two places, so I am inclined to just do it at the beginning
>> as there is good reason for doing it there when downsizing and for
>> the upsizing it does not really matter much.
> 
> With upsizing, if wantfreevnodes are set before desiredvnodes are
> increased, you can again get into the contradictory state, where
> the wantfreevnodes is larger than desiredvnodes.

Setting wantfreevnodes before adjusting the cache sizes always has
first set desiredvnodes. Waiting to set wantfreevnodes until after
the caches have been resized has no effect on desiredvnodes. It is
just less efficient to find them when desiredvnodes is rising.

	Kirk McKusick


More information about the freebsd-fs mailing list