From owner-svn-src-all@FreeBSD.ORG Sun Apr 22 17:10:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7D73A106566B; Sun, 22 Apr 2012 17:10:29 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 255448FC14; Sun, 22 Apr 2012 17:10:29 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 5E384305; Sun, 22 Apr 2012 19:10:21 +0200 (CEST) Date: Sun, 22 Apr 2012 19:08:43 +0200 From: Pawel Jakub Dawidek To: Kirk McKusick Message-ID: <20120422170842.GA18403@garage.freebsd.pl> References: <201204200650.q3K6oiqO026673@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="WIyZ46R2i8wDzkSu" Content-Disposition: inline In-Reply-To: <201204200650.q3K6oiqO026673@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r234482 - in head/sys: fs/msdosfs fs/nfsserver kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Apr 2012 17:10:29 -0000 --WIyZ46R2i8wDzkSu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 20, 2012 at 06:50:44AM +0000, Kirk McKusick wrote: > Author: mckusick > Date: Fri Apr 20 06:50:44 2012 > New Revision: 234482 > URL: http://svn.freebsd.org/changeset/base/234482 >=20 > Log: > This change creates a new list of active vnodes associated with > a mount point. Active vnodes are those with a non-zero use or hold > count, e.g., those vnodes that are not on the free list. Note that > this list is in addition to the list of all the vnodes associated > with a mount point. > =20 > To avoid adding another set of linkage pointers to the vnode > structure, the active list uses the existing linkage pointers > used by the free list (previously named v_freelist, now renamed > v_actfreelist). > =20 > This update adds the MNT_VNODE_FOREACH_ACTIVE interface that loops > over just the active vnodes associated with a mount point (typically > less than 1% of the vnodes associated with the mount point). [...] > @@ -1099,6 +1128,14 @@ insmntque1(struct vnode *vp, struct moun > VNASSERT(mp->mnt_nvnodelistsize >=3D 0, vp, > ("neg mount point vnode list size")); > mp->mnt_nvnodelistsize++; > + KASSERT((vp->v_iflag & VI_ACTIVE) =3D=3D 0, > + ("Activating already active vnode")); > + vp->v_iflag |=3D VI_ACTIVE; > + mtx_lock(&vnode_free_list_mtx); > + TAILQ_INSERT_HEAD(&mp->mnt_activevnodelist, vp, v_actfreelist); > + mp->mnt_activevnodelistsize++; > + mtx_unlock(&vnode_free_list_mtx); > + VI_UNLOCK(vp); > MNT_IUNLOCK(mp); > return (0); > } Now, for every vnode that is activated, it has to go through global mutex, which seems like scalability issue to me. With ZFS it is typical to have a lot of file systems and this global mutex was not needed before (well, it was needed, but only to get vnode from the free list). If we require vnode interlock to be held during v_actfreelist manipulation then why can't we use interlock+vnode_free_list_mtx when operating on the free list and interlock+per-mountpoint-lock when operating on mnt_activevnodelist? --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --WIyZ46R2i8wDzkSu Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAk+UOxoACgkQForvXbEpPzQcEgCdH9HqdUGwVAV2AzaqSYbZO+lk yo4AoJBykS7Df3yDmlcPVn18J+J0YABX =Yjmx -----END PGP SIGNATURE----- --WIyZ46R2i8wDzkSu--