Enable ADAPTIVE_MUTEXES by default by changing the sense of the option to
NO_ADAPTIVE_MUTEXES. This option has been enabled by default on amd64 for quite some time, and has been extensively tested on i386 and sparc64. It shows measurable performance gains in many circumstances, and few negative effects. It would be nice in t he future if adaptive mutexes actually went to sleep after a certain amount of spinning, but that will require quite a bit more testing.
This commit is contained in:
parent
7a76c247bd
commit
701f140800
@ -28,7 +28,6 @@ ident GENERIC
|
||||
makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols
|
||||
|
||||
options SCHED_ULE # ULE scheduler
|
||||
options ADAPTIVE_MUTEXES # mutexes first spin lock, then sleep
|
||||
options INET # InterNETworking
|
||||
options INET6 # IPv6 communications protocols
|
||||
options FFS # Berkeley Fast Filesystem
|
||||
|
@ -169,8 +169,9 @@ options SMP # Symmetric MultiProcessor Kernel
|
||||
|
||||
# ADAPTIVE_MUTEXES changes the behavior of blocking mutexes to spin
|
||||
# if the thread that currently owns the mutex is executing on another
|
||||
# CPU.
|
||||
options ADAPTIVE_MUTEXES
|
||||
# CPU. This behaviour is enabled by default, so this option can be used
|
||||
# to disable it.
|
||||
options NO_ADAPTIVE_MUTEXES
|
||||
|
||||
# MUTEX_NOINLINE forces mutex operations to call functions to perform each
|
||||
# operation rather than inlining the simple cases. This can be used to
|
||||
|
@ -56,7 +56,7 @@ KDB_TRACE opt_kdb.h
|
||||
KDB_UNATTENDED opt_kdb.h
|
||||
|
||||
# Miscellaneous options.
|
||||
ADAPTIVE_MUTEXES
|
||||
NO_ADAPTIVE_MUTEXES
|
||||
ALQ
|
||||
CODA_COMPAT_5 opt_coda.h
|
||||
COMPAT_43 opt_compat.h
|
||||
|
@ -421,7 +421,7 @@ _mtx_lock_sleep(struct mtx *m, int opts, const char *file, int line)
|
||||
{
|
||||
struct turnstile *ts;
|
||||
struct thread *td = curthread;
|
||||
#if defined(SMP) && defined(ADAPTIVE_MUTEXES)
|
||||
#if defined(SMP) && !defined(NO_ADAPTIVE_MUTEXES)
|
||||
struct thread *owner;
|
||||
#endif
|
||||
uintptr_t v;
|
||||
@ -503,7 +503,7 @@ _mtx_lock_sleep(struct mtx *m, int opts, const char *file, int line)
|
||||
continue;
|
||||
}
|
||||
|
||||
#if defined(SMP) && defined(ADAPTIVE_MUTEXES)
|
||||
#if defined(SMP) && !defined(NO_ADAPTIVE_MUTEXES)
|
||||
/*
|
||||
* If the current owner of the lock is executing on another
|
||||
* CPU, spin instead of blocking.
|
||||
@ -518,7 +518,7 @@ _mtx_lock_sleep(struct mtx *m, int opts, const char *file, int line)
|
||||
}
|
||||
continue;
|
||||
}
|
||||
#endif /* SMP && ADAPTIVE_MUTEXES */
|
||||
#endif /* SMP && !NO_ADAPTIVE_MUTEXES */
|
||||
|
||||
/*
|
||||
* We definitely must sleep for this lock.
|
||||
|
Loading…
Reference in New Issue
Block a user