From owner-dev-commits-src-all@freebsd.org Sat May 22 18:23:55 2021 Return-Path: Delivered-To: dev-commits-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 3B003634015; Sat, 22 May 2021 18:23:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FnX1715C3z4TvF; Sat, 22 May 2021 18:23:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 09C8EDC5; Sat, 22 May 2021 18:23:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 14MINsGQ005838; Sat, 22 May 2021 18:23:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 14MINsbl005837; Sat, 22 May 2021 18:23:54 GMT (envelope-from git) Date: Sat, 22 May 2021 18:23:54 GMT Message-Id: <202105221823.14MINsbl005837@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 0ef41997b3c7 - stable/13 - cache: remove incomplete lockless lockout support during resize MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0ef41997b3c740dc5369b1dfac82ac107fe7d707 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 May 2021 18:23:55 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=0ef41997b3c740dc5369b1dfac82ac107fe7d707 commit 0ef41997b3c740dc5369b1dfac82ac107fe7d707 Author: Mateusz Guzik AuthorDate: 2021-04-10 17:20:28 +0000 Commit: Mateusz Guzik CommitDate: 2021-05-22 18:21:39 +0000 cache: remove incomplete lockless lockout support during resize This is already properly handled thanks to 2 step hash replacement. (cherry picked from commit 074abaccfaadef0da6e2695225ce537cb53bb8de) --- sys/kern/vfs_cache.c | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index ec5bb0c39c99..2def9900096f 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -580,9 +580,6 @@ static long cache_lock_vnodes_cel_3_failures; DEBUGNODE_ULONG(vnodes_cel_3_failures, cache_lock_vnodes_cel_3_failures, "Number of times 3-way vnode locking failed"); -static void cache_fplookup_lockout(void); -static void cache_fplookup_restore(void); - static void cache_zap_locked(struct namecache *ncp); static int vn_fullpath_hardlink(struct nameidata *ndp, char **retbuf, char **freebuf, size_t *buflen); @@ -2771,7 +2768,6 @@ cache_changesize(u_long newmaxvnodes) * None of the namecache entries in the table can be removed * because to do so, they have to be removed from the hash table. */ - cache_fplookup_lockout(); cache_lock_all_vnodes(); cache_lock_all_buckets(); old_nchashtbl = nchashtbl; @@ -2790,7 +2786,6 @@ cache_changesize(u_long newmaxvnodes) cache_changesize_set_new(new_nchashtbl, new_nchash); cache_unlock_all_buckets(); cache_unlock_all_vnodes(); - cache_fplookup_restore(); ncfreetbl(old_nchashtbl); ncfreetbl(temptbl); } @@ -3865,33 +3860,6 @@ syscal_vfs_cache_fast_lookup(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_vfs, OID_AUTO, cache_fast_lookup, CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_MPSAFE, &cache_fast_lookup, 0, syscal_vfs_cache_fast_lookup, "IU", ""); -/* - * Disable lockless lookup and observe all CPUs not executing it. - * - * Used when resizing the hash table. - * - * TODO: no provisions are made to handle tweaking of the knob at the same time - */ -static void -cache_fplookup_lockout(void) -{ - bool on; - - on = atomic_load_char(&cache_fast_lookup_enabled); - if (on) { - atomic_store_char(&cache_fast_lookup_enabled, false); - atomic_thread_fence_rel(); - vfs_smr_synchronize(); - } -} - -static void -cache_fplookup_restore(void) -{ - - cache_fast_lookup_enabled_recalc(); -} - /* * Components of nameidata (or objects it can point to) which may * need restoring in case fast path lookup fails.