From owner-freebsd-fs@freebsd.org Thu Nov 5 18:56:57 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 5E233A264F4 for ; Thu, 5 Nov 2015 18:56:57 +0000 (UTC) (envelope-from mckusick@mckusick.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 496951B6C for ; Thu, 5 Nov 2015 18:56:57 +0000 (UTC) (envelope-from mckusick@mckusick.com) Received: by mailman.ysv.freebsd.org (Postfix) id 471B4A264F0; Thu, 5 Nov 2015 18:56:57 +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 45CA6A264EF for ; Thu, 5 Nov 2015 18:56:57 +0000 (UTC) (envelope-from mckusick@mckusick.com) Received: from chez.mckusick.com (chez.mckusick.com [IPv6:2001:5a8:4:7e72:d250:99ff:fe57:4030]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B0A61B6A for ; Thu, 5 Nov 2015 18:56:57 +0000 (UTC) (envelope-from mckusick@mckusick.com) Received: from chez.mckusick.com (localhost [IPv6:::1]) by chez.mckusick.com (8.15.2/8.14.9) with ESMTP id tA5Iutge064958; Thu, 5 Nov 2015 10:56:55 -0800 (PST) (envelope-from mckusick@chez.mckusick.com) Message-Id: <201511051856.tA5Iutge064958@chez.mckusick.com> From: Kirk McKusick To: Konstantin Belousov Subject: Re: an easy (?) question on namecache sizing cc: Bruce Evans , fs@freebsd.org In-reply-to: <20151103090448.GC2257@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <64956.1446749815.1@chez.mckusick.com> Date: Thu, 05 Nov 2015 10:56:55 -0800 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: Thu, 05 Nov 2015 18:56:57 -0000 > Date: Tue, 3 Nov 2015 11:04:48 +0200 > From: Konstantin Belousov > To: Kirk McKusick > Subject: Re: an easy (?) question on namecache sizing > > Free vnodes could be freed in the soft fashion by vnlru daemon, or in > hard manner, by the getnewvnode(), when the max for the vnode count is > reached. The 'soft' way skips vnodes which are directories, to make it > more probable that vn_fullpath() would succeed, and also has threshold > for the count of cached pages. The 'hard' way waits up to 1 sec for > the vnlru daemon to succeed, before forcing a recycle for any vnode, > regardless of the 'soft' stoppers. This causes the ticking behaviour of > the system when only one vnode operation in single thread succeeds in a > second. > > Large wantfreevnodes value is the safety measure to prevent the tick > steps in practice. My initial reaction on the complain was to just > suggest to increase desiredvnodes, at least this is what I do on > machines where there is a lot of both KVA and memory and intensive file > loads are expected. I propose that we update wantfreevnodes in sysctl_update_desiredvnodes() so that it tracks the change in desiredvnodes: Index: /sys/kern/vfs_subr.c =================================================================== --- /sys/kern/vfs_subr.c (revision 290387) +++ /sys/kern/vfs_subr.c (working copy) @@ -293,6 +293,7 @@ if (old_desiredvnodes != desiredvnodes) { vfs_hash_changesize(desiredvnodes); cache_changesize(desiredvnodes); + wantfreevnodes = desiredvnodes / 4; } return (0); } Otherwise bumping up desiredvnodes will be less effective than expected. I see that Bruce has also suggested this change in his more extensive revisions. Kirk McKusick