1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-18 10:35:55 +00:00
freebsd/sys
John Baldwin 2498cf8c42 Add code to make default mutexes adaptive if the ADAPTIVE_MUTEXES kernel
option is used (not on by default).

- In the case of trying to lock a mutex, if the MTX_CONTESTED flag is set,
  then we can safely read the thread pointer from the mtx_lock member while
  holding sched_lock.  We then examine the thread to see if it is currently
  executing on another CPU.  If it is, then we keep looping instead of
  blocking.
- In the case of trying to unlock a mutex, it is now possible for a mutex
  to have MTX_CONTESTED set in mtx_lock but to not have any threads
  actually blocked on it, so we need to handle that case.  In that case,
  we just release the lock as if MTX_CONTESTED was not set and return.
- We do not adaptively spin on Giant as Giant is held for long times and
  it slows SMP systems down to a crawl (it was taking several minutes,
  like 5-10 or so for my test alpha and sparc64 SMP boxes to boot up when
  they adaptively spinned on Giant).
- We only compile in the code to do this for SMP kernels, it doesn't make
  sense for UP kernels.

Tested on:	i386, alpha, sparc64
2002-05-21 20:47:11 +00:00
..
alpha - Apparently, the Alpha ABI mandates that arguments be passed sign-extended 2002-05-17 05:45:39 +00:00
amd64 Add an inline function cpu_pause() for the IA32 'pause' instruction. 2002-05-21 20:21:53 +00:00
arm Move MI stuff out of MD param.h files. 2002-05-14 20:35:29 +00:00
boot Fixed to conflict labels. 2002-05-21 12:53:48 +00:00
cam Add a Quirk entry for the USB SimpleTech UCF-100 compact flash reader. 2002-05-19 21:59:28 +00:00
coda More s/file system/filesystem/g 2002-05-16 21:28:32 +00:00
compat Lock down a socket, milestone 1. 2002-05-20 05:41:09 +00:00
conf Add code to make default mutexes adaptive if the ADAPTIVE_MUTEXES kernel 2002-05-21 20:47:11 +00:00
contrib Merge updates from 3.4.26 - 3.4.27. 2002-04-27 16:56:25 +00:00
crypto Remove macros that are defined elsewhere. 2002-04-21 10:32:48 +00:00
ddb Reconnect db_elf.c to the build (now under "options DDB_NOKLDSYM"). It 2002-05-07 10:59:52 +00:00
dev Use correct inactivity timeout of 2 minutes rather than 24 seconds due to 2002-05-20 19:33:49 +00:00
fs Fix null_lock() not unlocking vp->v_interlock if LK_THISLAYER. 2002-05-21 18:07:33 +00:00
geom Introduce the concept of "magic spaces", and implement them in most of 2002-05-21 20:33:49 +00:00
gnu Add an ext2_uninit() routine that undoes the actions performed by 2002-05-18 22:18:17 +00:00
i4b Fix a problem which could cause some machines to hang after a warm boot. 2002-05-10 12:04:04 +00:00
i386 Add an inline function cpu_pause() for the IA32 'pause' instruction. 2002-05-21 20:21:53 +00:00
ia64 Flesh-out ptrace support. This obviously needs more work. 2002-05-20 05:41:20 +00:00
isa After some comments from bde, rewrite the loops to avoid turning the 2002-05-14 21:28:45 +00:00
isofs/cd9660 More s/file system/filesystem/g 2002-05-16 21:28:32 +00:00
kern Add code to make default mutexes adaptive if the ADAPTIVE_MUTEXES kernel 2002-05-21 20:47:11 +00:00
libkern
modules Remove asr from the ia64 build. Its use of KERNBASE appears i386 2002-05-19 03:59:06 +00:00
net Avoid exposing struct if_clone and the sys/queue.h macros to userland 2002-05-20 22:48:39 +00:00
netatalk Lock down a socket, milestone 1. 2002-05-20 05:41:09 +00:00
netatm Lock down a socket, milestone 1. 2002-05-20 05:41:09 +00:00
netgraph Lock down a socket, milestone 1. 2002-05-20 05:41:09 +00:00
netinet - Change the newly turned INVARIANTS #ifdef blocks (they were changed from 2002-05-21 18:52:24 +00:00
netinet6 Lock down a socket, milestone 1. 2002-05-20 05:41:09 +00:00
netipx Lock down a socket, milestone 1. 2002-05-20 05:41:09 +00:00
netkey Lock down a socket, milestone 1. 2002-05-20 05:41:09 +00:00
netnatm Lock down a socket, milestone 1. 2002-05-20 05:41:09 +00:00
netncp Lock down a socket, milestone 1. 2002-05-20 05:41:09 +00:00
netns Lock down a socket, milestone 1. 2002-05-20 05:41:09 +00:00
netsmb Lock down a socket, milestone 1. 2002-05-20 05:41:09 +00:00
nfs
nfsclient Lock down a socket, milestone 1. 2002-05-20 05:41:09 +00:00
nfsserver Lock down a socket, milestone 1. 2002-05-20 05:41:09 +00:00
pc98 MFi386: revision 1.519 2002-05-14 12:31:47 +00:00
pccard
pci Enhance the use of the watchdog timer in this driver so that it will 2002-05-15 17:05:28 +00:00
posix4 Change p_can{debug,see,sched,signal}()'s first argument to be a thread 2002-05-19 00:14:50 +00:00
powerpc Make this more FreeBSD-ish. 2002-05-19 08:16:25 +00:00
rpc
security/lomac Lock down a socket, milestone 1. 2002-05-20 05:41:09 +00:00
sparc64 Update tsb_tte_enter prototype per tsb.c rev 1.20. 2002-05-21 02:15:37 +00:00
sys Optimize spin mutexes for UP kernels without debugging to just enter and 2002-05-21 20:34:28 +00:00
tools include systm.h in vnode_if.c so that panic is defined when we're doing 2002-05-04 02:35:13 +00:00
ufs Remove IFS from 5.0-CURRENT. This facilitates introducing UFS2 as 2002-05-19 00:11:08 +00:00
vm In uma_zalloc_arg(), if we are performing a M_WAITOK allocation, ensure 2002-05-20 17:54:48 +00:00
Makefile Milestone #1 in cross-arch make releases. 2002-04-26 17:55:27 +00:00