svn commit: r357906 - in head/sys: kern sys

Mateusz Guzik mjg at FreeBSD.org
Fri Feb 14 11:20:26 UTC 2020


Author: mjg
Date: Fri Feb 14 11:20:25 2020
New Revision: 357906
URL: https://svnweb.freebsd.org/changeset/base/357906

Log:
  lockmgr: retire the unused lockmgr_unlock_fast_path routine

Modified:
  head/sys/kern/kern_lock.c
  head/sys/sys/lockmgr.h

Modified: head/sys/kern/kern_lock.c
==============================================================================
--- head/sys/kern/kern_lock.c	Fri Feb 14 09:36:35 2020	(r357905)
+++ head/sys/kern/kern_lock.c	Fri Feb 14 11:20:25 2020	(r357906)
@@ -1114,46 +1114,6 @@ out:
 	return (0);
 }
 
-int
-lockmgr_unlock_fast_path(struct lock *lk, u_int flags, struct lock_object *ilk)
-{
-	struct lock_class *class;
-	uintptr_t x, tid;
-	const char *file;
-	int line;
-
-	if (KERNEL_PANICKED())
-		return (0);
-
-	file = __FILE__;
-	line = __LINE__;
-
-	_lockmgr_assert(lk, KA_LOCKED, file, line);
-	x = lk->lk_lock;
-	if (__predict_true(x & LK_SHARE) != 0) {
-		lockmgr_note_shared_release(lk, file, line);
-		if (lockmgr_sunlock_try(lk, &x)) {
-			LOCKSTAT_PROFILE_RELEASE_RWLOCK(lockmgr__release, lk, LOCKSTAT_READER);
-		} else {
-			return (lockmgr_sunlock_hard(lk, x, flags, ilk, file, line));
-		}
-	} else {
-		tid = (uintptr_t)curthread;
-		lockmgr_note_exclusive_release(lk, file, line);
-		if (!lockmgr_recursed(lk) &&
-		    atomic_cmpset_rel_ptr(&lk->lk_lock, tid, LK_UNLOCKED)) {
-			LOCKSTAT_PROFILE_RELEASE_RWLOCK(lockmgr__release, lk, LOCKSTAT_WRITER);
-		} else {
-			return (lockmgr_xunlock_hard(lk, x, flags, ilk, file, line));
-		}
-	}
-	if (__predict_false(flags & LK_INTERLOCK)) {
-		class = LOCK_CLASS(ilk);
-		class->lc_unlock(ilk);
-	}
-	return (0);
-}
-
 /*
  * Lightweight entry points for common operations.
  *

Modified: head/sys/sys/lockmgr.h
==============================================================================
--- head/sys/sys/lockmgr.h	Fri Feb 14 09:36:35 2020	(r357905)
+++ head/sys/sys/lockmgr.h	Fri Feb 14 11:20:25 2020	(r357906)
@@ -72,8 +72,6 @@ int	 __lockmgr_args(struct lock *lk, u_int flags, stru
 	    const char *wmesg, int prio, int timo, const char *file, int line);
 int	 lockmgr_lock_fast_path(struct lock *lk, u_int flags,
 	    struct lock_object *ilk, const char *file, int line);
-int	 lockmgr_unlock_fast_path(struct lock *lk, u_int flags,
-	    struct lock_object *ilk);
 int	lockmgr_slock(struct lock *lk, u_int flags, const char *file, int line);
 int	lockmgr_xlock(struct lock *lk, u_int flags, const char *file, int line);
 int	lockmgr_unlock(struct lock *lk);


More information about the svn-src-all mailing list