Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 Dec 2019 00:35:08 +0000 (UTC)
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r355256 - in head/sys: kern sys
Message-ID:  <201912010035.xB10Z8du009677@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mjg
Date: Sun Dec  1 00:35:08 2019
New Revision: 355256
URL: https://svnweb.freebsd.org/changeset/base/355256

Log:
  lockmgr: remove more remnants of adaptive spinning
  
  Sponsored by:	The FreeBSD Foundation

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	Sun Dec  1 00:34:49 2019	(r355255)
+++ head/sys/kern/kern_lock.c	Sun Dec  1 00:35:08 2019	(r355256)
@@ -61,8 +61,6 @@ __FBSDID("$FreeBSD$");
 PMC_SOFT_DECLARE( , , lock, failed);
 #endif
 
-CTASSERT(((LK_ADAPTIVE | LK_NOSHARE) & LO_CLASSFLAGS) ==
-    (LK_ADAPTIVE | LK_NOSHARE));
 CTASSERT(LK_UNLOCKED == (LK_UNLOCKED &
     ~(LK_ALL_WAITERS | LK_EXCLUSIVE_SPINNERS)));
 
@@ -136,10 +134,6 @@ LK_CAN_SHARE(uintptr_t x, int flags, bool fp)
 #define	LK_TRYWIT(x)							\
 	(LK_TRYOP(x) ? LOP_TRYLOCK : 0)
 
-#define	LK_CAN_ADAPT(lk, f)						\
-	(((lk)->lock_object.lo_flags & LK_ADAPTIVE) != 0 &&		\
-	((f) & LK_SLEEPFAIL) == 0)
-
 #define	lockmgr_disowned(lk)						\
 	(((lk)->lk_lock & ~(LK_FLAGMASK & ~LK_SHARE)) == LK_KERNPROC)
 
@@ -453,7 +447,7 @@ lockinit(struct lock *lk, int pri, const char *wmesg, 
 		iflags |= LO_IS_VNODE;
 	if (flags & LK_NEW)
 		iflags |= LO_NEW;
-	iflags |= flags & (LK_ADAPTIVE | LK_NOSHARE);
+	iflags |= flags & LK_NOSHARE;
 
 	lock_init(&lk->lock_object, &lock_class_lockmgr, wmesg, NULL, iflags);
 	lk->lk_lock = LK_UNLOCKED;

Modified: head/sys/sys/lockmgr.h
==============================================================================
--- head/sys/sys/lockmgr.h	Sun Dec  1 00:34:49 2019	(r355255)
+++ head/sys/sys/lockmgr.h	Sun Dec  1 00:35:08 2019	(r355256)
@@ -150,7 +150,7 @@ _lockmgr_args_rw(struct lock *lk, u_int flags, struct 
 #define	LK_NOSHARE	0x000008
 #define	LK_NOWITNESS	0x000010
 #define	LK_QUIET	0x000020
-#define	LK_ADAPTIVE	0x000040
+#define	LK_UNUSED0	0x000040	/* Was LK_ADAPTIVE */
 #define	LK_IS_VNODE	0x000080	/* Tell WITNESS about a VNODE lock */
 #define	LK_NEW		0x000100
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201912010035.xB10Z8du009677>