From owner-freebsd-fs@freebsd.org Fri Nov 6 18:51:00 2015 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33438A283DC for ; Fri, 6 Nov 2015 18:51:00 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 16BE31E91 for ; Fri, 6 Nov 2015 18:51:00 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 16483A283DB; Fri, 6 Nov 2015 18:51:00 +0000 (UTC) Delivered-To: fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15DDEA283DA for ; Fri, 6 Nov 2015 18:51:00 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 83E261E8F for ; Fri, 6 Nov 2015 18:50:59 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id tA6IosTV042274 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 6 Nov 2015 20:50:54 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua tA6IosTV042274 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id tA6IorXZ042271; Fri, 6 Nov 2015 20:50:53 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 6 Nov 2015 20:50:53 +0200 From: Konstantin Belousov To: Kirk McKusick Cc: fs@freebsd.org Subject: Re: an easy (?) question on namecache sizing Message-ID: <20151106185053.GS2257@kib.kiev.ua> References: <20151105205255.GL2257@kib.kiev.ua> <201511052107.tA5L7QBB067460@chez.mckusick.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201511052107.tA5L7QBB067460@chez.mckusick.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Nov 2015 18:51:00 -0000 On Thu, Nov 05, 2015 at 01:07:26PM -0800, Kirk McKusick wrote: > > Date: Thu, 5 Nov 2015 22:52:55 +0200 > > From: Konstantin Belousov > > To: Kirk McKusick > > Subject: Re: an easy (?) question on namecache sizing > > Cc: fs@freebsd.org > > > > On Thu, Nov 05, 2015 at 12:25:38PM -0800, Kirk McKusick wrote: > >> > >> Does moving the setting of wantfreevnodes before the cache size changes > >> (as redone above) close the window enough? The vlrureclaim() function > >> operates slowly enough that a brief period of inconsistency seems > >> unimportant. Changing desiredvnodes happens very rarely. And at the moment > >> we are not correcting wantfreevnodes at all. Or am I missing some key point? > > > > 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.