From owner-svn-src-all@freebsd.org Wed Sep 23 16:44:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 046123FEB34; Wed, 23 Sep 2020 16:44:39 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BxPCp22T9z3Zm3; Wed, 23 Sep 2020 16:44:38 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 08NGiTLT082922 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 23 Sep 2020 19:44:32 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 08NGiTLT082922 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 08NGiTO7082921; Wed, 23 Sep 2020 19:44:29 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 23 Sep 2020 19:44:29 +0300 From: Konstantin Belousov To: Mateusz Guzik Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r366071 - in head/sys: contrib/openzfs/module/os/freebsd/zfs kern sys Message-ID: <20200923164429.GI2570@kib.kiev.ua> References: <202009231046.08NAk7oW012157@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202009231046.08NAk7oW012157@repo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4BxPCp22T9z3Zm3 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 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: Wed, 23 Sep 2020 16:44:39 -0000 On Wed, Sep 23, 2020 at 10:46:07AM +0000, Mateusz Guzik wrote: > Author: mjg > Date: Wed Sep 23 10:46:07 2020 > New Revision: 366071 > URL: https://svnweb.freebsd.org/changeset/base/366071 > > Log: > cache: drop the force flag from purgevfs > > The optional scan is wasteful, thus it is removed altogether from unmount. > > Callers which always want it anyway remain unaffected. > > Modified: > head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c > head/sys/kern/vfs_cache.c > head/sys/kern/vfs_mount.c > head/sys/kern/vfs_mountroot.c > head/sys/sys/vnode.h > > Modified: head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c > ============================================================================== > --- head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c Wed Sep 23 10:44:49 2020 (r366070) > +++ head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c Wed Sep 23 10:46:07 2020 (r366071) > @@ -1532,7 +1532,7 @@ zfsvfs_teardown(zfsvfs_t *zfsvfs, boolean_t unmounting > * 'z_parent' is self referential for non-snapshots. > */ > #ifdef FREEBSD_NAMECACHE > - cache_purgevfs(zfsvfs->z_parent->z_vfs, true); > + cache_purgevfs(zfsvfs->z_parent->z_vfs); > #endif > } > > > Modified: head/sys/kern/vfs_cache.c > ============================================================================== > --- head/sys/kern/vfs_cache.c Wed Sep 23 10:44:49 2020 (r366070) > +++ head/sys/kern/vfs_cache.c Wed Sep 23 10:46:07 2020 (r366071) > @@ -295,9 +295,6 @@ static u_long __exclusive_cache_line numcache;/* numbe > u_int ncsizefactor = 2; > SYSCTL_UINT(_vfs, OID_AUTO, ncsizefactor, CTLFLAG_RW, &ncsizefactor, 0, > "Size factor for namecache"); > -static u_int __read_mostly ncpurgeminvnodes; > -SYSCTL_UINT(_vfs, OID_AUTO, ncpurgeminvnodes, CTLFLAG_RW, &ncpurgeminvnodes, 0, > - "Number of vnodes below which purgevfs ignores the request"); > static u_int __read_mostly ncsize; /* the size as computed on creation or resizing */ > > struct nchstats nchstats; /* cache effectiveness statistics */ > @@ -2142,7 +2139,6 @@ nchinit(void *dummy __unused) > M_WAITOK | M_ZERO); > for (i = 0; i < numvnodelocks; i++) > mtx_init(&vnodelocks[i], "ncvn", NULL, MTX_DUPOK | MTX_RECURSE); > - ncpurgeminvnodes = numbucketlocks * 2; > > neglists = malloc(sizeof(*neglists) * numneglists, M_VFSCACHE, > M_WAITOK | M_ZERO); > @@ -2369,14 +2365,11 @@ cache_rename(struct vnode *fdvp, struct vnode *fvp, st > * Flush all entries referencing a particular filesystem. > */ > void > -cache_purgevfs(struct mount *mp, bool force) > +cache_purgevfs(struct mount *mp) > { > struct vnode *vp, *mvp; > > SDT_PROBE1(vfs, namecache, purgevfs, done, mp); > - if (!force && mp->mnt_nvnodelistsize <= ncpurgeminvnodes) > - return; > - > /* > * Somewhat wasteful iteration over all vnodes. Would be better to > * support filtering and avoid the interlock to begin with. > > Modified: head/sys/kern/vfs_mount.c > ============================================================================== > --- head/sys/kern/vfs_mount.c Wed Sep 23 10:44:49 2020 (r366070) > +++ head/sys/kern/vfs_mount.c Wed Sep 23 10:46:07 2020 (r366071) > @@ -1808,7 +1808,6 @@ dounmount(struct mount *mp, int flags, struct thread * > mp->mnt_flag &= ~MNT_ASYNC; > mp->mnt_kern_flag &= ~MNTK_ASYNC; > MNT_IUNLOCK(mp); > - cache_purgevfs(mp, false); /* remove cache entries for this file sys */ > vfs_deallocate_syncvnode(mp); > error = VFS_UNMOUNT(mp, flags); Is there any checker for debugging kernels, that no cache entries are left after unmount ? > vn_finished_write(mp);