freebsd-dev/sys/kern
David Xu 17ce606321 umtx operation UMTX_OP_MUTEX_WAKE has a side-effect that it accesses
a mutex after a thread has unlocked it, it event writes data to the mutex
memory to clear contention bit, there is a race that other threads
can lock it and unlock it, then destroy it, so it should not write
data to the mutex memory if there isn't any waiter.
The new operation UMTX_OP_MUTEX_WAKE2 try to fix the problem. It
requires thread library to clear the lock word entirely, then
call the WAKE2 operation to check if there is any waiter in kernel,
and try to wake up a thread, if necessary, the contention bit is set again
by the operation. This also mitgates the chance that other threads find
the contention bit and try to enter kernel to compete with each other
to wake up sleeping thread, this is unnecessary. With this change, the
mutex owner is no longer holding the mutex until it reaches a point
where kernel umtx queue is locked, it releases the mutex as soon as
possible.
Performance is improved when the mutex is contensted heavily.  On Intel
i3-2310M, the runtime of a benchmark program is reduced from 26.87 seconds
to 2.39 seconds, it even is better than UMTX_OP_MUTEX_WAKE which is
deprecated now. http://people.freebsd.org/~davidxu/bench/mutex_perf.c
2012-04-05 02:24:08 +00:00
..
bus_if.m
capabilities.conf
clock_if.m
cpufreq_if.m
device_if.m
genassym.sh
imgact_aout.c
imgact_elf32.c
imgact_elf64.c
imgact_elf.c ELF image can have several PT_NOTE program headers. Look for the ELF 2012-03-11 19:38:49 +00:00
imgact_gzip.c Fix misuse of the kernel map in miscellaneous image activators. 2012-02-17 23:47:16 +00:00
imgact_shell.c
inflate.c
init_main.c
init_sysent.c
kern_acct.c
kern_alq.c
kern_clock.c Add software PMC support. 2012-03-28 20:58:30 +00:00
kern_clocksource.c Add kern.eventtimer.activetick tunable/sysctl, specifying whether each 2012-03-13 10:21:08 +00:00
kern_condvar.c
kern_conf.c Remove unneeded newline. It fits in 80 columns now. 2012-02-10 14:55:47 +00:00
kern_cons.c
kern_context.c
kern_cpu.c Revert r175376 and tune cpufreq(4) frequency comparison logic instead. 2012-03-10 18:56:16 +00:00
kern_cpuset.c
kern_ctf.c Fix found places where uio_resid is truncated to int. 2012-02-21 01:05:12 +00:00
kern_descrip.c Export some more useful info about shared memory objects to userland 2012-04-01 18:22:48 +00:00
kern_dtrace.c
kern_environment.c
kern_et.c
kern_event.c - Add knlist_init_rw_reader() function to kqueue(9). 2012-03-26 09:34:17 +00:00
kern_exec.c Add a new sched_clear_name() method to the scheduler interface to clear 2012-03-08 19:41:05 +00:00
kern_exit.c When process exists, not only the children shall be reparented to 2012-04-02 19:35:36 +00:00
kern_fail.c
kern_ffclock.c
kern_fork.c Currently, the debugger attached to the process executing vfork() does 2012-02-27 21:10:10 +00:00
kern_gzio.c Fix found places where uio_resid is truncated to int. 2012-02-21 01:05:12 +00:00
kern_hhook.c
kern_idle.c
kern_intr.c Export intrcnt correctly when running under 32-bit compatibility. 2012-03-09 22:30:54 +00:00
kern_jail.c Make racct and rctl correctly handle jail renaming. Previously 2012-03-06 11:05:50 +00:00
kern_khelp.c
kern_kthread.c Add a new sched_clear_name() method to the scheduler interface to clear 2012-03-08 19:41:05 +00:00
kern_ktr.c
kern_ktrace.c Fix found places where uio_resid is truncated to int. 2012-02-21 01:05:12 +00:00
kern_linker.c Correct debug message. 2012-03-22 09:29:07 +00:00
kern_lock.c Add software PMC support. 2012-03-28 20:58:30 +00:00
kern_lockf.c
kern_lockstat.c
kern_loginclass.c
kern_malloc.c - Change contigmalloc() to use the vm_paddr_t type instead of an unsigned 2012-03-01 19:58:34 +00:00
kern_mbuf.c
kern_mib.c
kern_module.c
kern_mtxpool.c
kern_mutex.c Add software PMC support. 2012-03-28 20:58:30 +00:00
kern_ntptime.c
kern_osd.c
kern_physio.c
kern_pmc.c Add software PMC support. 2012-03-28 20:58:30 +00:00
kern_poll.c
kern_priv.c
kern_proc.c Add a sysctl to set and retrieve binary osreldate of another process. 2012-03-23 20:05:41 +00:00
kern_prot.c
kern_racct.c Cast wallclock.tv_sec to uint64_t to avoid overflow in the calculation. 2012-03-18 19:13:32 +00:00
kern_rctl.c
kern_resource.c
kern_rmlock.c
kern_rwlock.c Add software PMC support. 2012-03-28 20:58:30 +00:00
kern_sdt.c Instead of only iterating over the set of known SDT probes when sdt.ko is 2012-03-27 15:07:43 +00:00
kern_sema.c
kern_shutdown.c Avoid to check the same cache line/variable from all the locking 2012-01-28 14:00:21 +00:00
kern_sig.c
kern_switch.c
kern_sx.c Add software PMC support. 2012-03-28 20:58:30 +00:00
kern_synch.c
kern_syscalls.c
kern_sysctl.c Handle spurious page faults that may occur in no-fault sections of the 2012-03-22 04:52:51 +00:00
kern_tc.c o) Add COMPAT_FREEBSD32 support for MIPS kernels using the n64 ABI with userlands 2012-03-03 08:19:18 +00:00
kern_thr.c Add a new sched_clear_name() method to the scheduler interface to clear 2012-03-08 19:41:05 +00:00
kern_thread.c
kern_time.c
kern_timeout.c
kern_umtx.c umtx operation UMTX_OP_MUTEX_WAKE has a side-effect that it accesses 2012-04-05 02:24:08 +00:00
kern_uuid.c
kern_xxx.c
ksched.c
link_elf_obj.c Fix found places where uio_resid is truncated to int. 2012-02-21 01:05:12 +00:00
link_elf.c Fix found places where uio_resid is truncated to int. 2012-02-21 01:05:12 +00:00
linker_if.m
Make.tags.inc
Makefile
makesyscalls.sh
md4c.c
md5c.c
p1003_1b.c
posix4_mib.c
sched_4bsd.c Add a new sched_clear_name() method to the scheduler interface to clear 2012-03-08 19:41:05 +00:00
sched_ule.c Rewrite thread CPU usage percentage math to not depend on periodic calls 2012-03-13 08:18:54 +00:00
serdev_if.m
stack_protector.c
subr_acl_nfs4.c Add module load/unload stubs. 2012-03-13 20:27:48 +00:00
subr_acl_posix1e.c Add module load/unload stubs. 2012-03-13 20:27:48 +00:00
subr_autoconf.c
subr_blist.c
subr_bufring.c
subr_bus.c Properly clear a device's devclass if DEVICE_ATTACH() fails if the device 2012-02-28 19:16:02 +00:00
subr_clock.c
subr_devstat.c
subr_disk.c
subr_eventhandler.c
subr_fattime.c
subr_firmware.c
subr_hash.c
subr_hints.c
subr_kdb.c
subr_kobj.c
subr_lock.c
subr_log.c Add kqueue support to /dev/klog. 2012-02-01 14:34:52 +00:00
subr_mbpool.c
subr_mchain.c - Use uint8_t for the variable x and spell the size of the variable 2012-02-06 06:03:16 +00:00
subr_module.c
subr_msgbuf.c - Clean up timestamps in msgbuf code. The timestamps should now be 2012-03-19 00:36:32 +00:00
subr_param.c
subr_pcpu.c
subr_power.c
subr_prf.c
subr_prof.c
subr_rman.c
subr_rtc.c
subr_sbuf.c
subr_scanf.c
subr_sglist.c
subr_sleepqueue.c
subr_smp.c
subr_stack.c
subr_syscall.c Currently, the debugger attached to the process executing vfork() does 2012-02-27 21:10:10 +00:00
subr_taskqueue.c
subr_trap.c Add software PMC support. 2012-03-28 20:58:30 +00:00
subr_turnstile.c
subr_uio.c Handle spurious page faults that may occur in no-fault sections of the 2012-03-22 04:52:51 +00:00
subr_unit.c
subr_witness.c
sys_capability.c Allways call fdrop(). 2012-03-12 11:56:57 +00:00
sys_generic.c Instead of incomplete handling of read(2)/write(2) return values that 2012-03-04 14:55:37 +00:00
sys_pipe.c Remove fifo.h. The only used function declaration from the header is 2012-03-11 12:19:58 +00:00
sys_procdesc.c
sys_process.c Allow the parent to gather the exit status of the children reparented 2012-02-23 11:50:23 +00:00
sys_socket.c
syscalls.c
syscalls.master
systrace_args.c
sysv_ipc.c
sysv_msg.c
sysv_sem.c
sysv_shm.c Close a race due to dropping of the map lock between creating a map entry 2012-02-19 00:28:49 +00:00
tty_compat.c
tty_info.c Fix whitespace inconsistencies in TTY code. 2012-02-06 18:15:46 +00:00
tty_inq.c
tty_outq.c
tty_pts.c
tty_tty.c
tty_ttydisc.c Fix found places where uio_resid is truncated to int. 2012-02-21 01:05:12 +00:00
tty.c Also call the low-level driver if ->c_iflag & (IXON|IXOFF|IXANY) changes. 2012-02-26 20:56:49 +00:00
uipc_accf.c
uipc_cow.c
uipc_debug.c
uipc_domain.c Catch up with r195837 (2.5 years ago) which renamed net_add_domain() to domain_add(). 2012-02-23 17:47:19 +00:00
uipc_mbuf2.c
uipc_mbuf.c Fix found places where uio_resid is truncated to int. 2012-02-21 01:05:12 +00:00
uipc_mqueue.c
uipc_sem.c
uipc_shm.c Export some more useful info about shared memory objects to userland 2012-04-01 18:22:48 +00:00
uipc_sockbuf.c
uipc_socket.c - Remove redundant call to pr_ctloutput from code that handles SO_SETFIB. 2012-04-03 18:38:00 +00:00
uipc_syscalls.c Fix bugs which can result in a panic when an non-SCTP socket it 2012-03-15 14:13:38 +00:00
uipc_usrreq.c Introduce VOP_UNP_BIND(), VOP_UNP_CONNECT(), and VOP_UNP_DETACH() 2012-02-29 21:38:31 +00:00
vfs_acl.c
vfs_aio.c Add 32-bit compat code for AIO kevent flags introduced in revision 230857. 2012-02-05 04:49:31 +00:00
vfs_bio.c This change avoids a kernel deadlock on "snaplk" when using 2012-03-01 18:45:25 +00:00
vfs_cache.c Post r230394, the Lookup RPC counts for both NFS clients increased 2012-03-03 01:06:54 +00:00
vfs_cluster.c Unbreak detection of the async mode for clustered writes after r231075. 2012-02-08 15:07:19 +00:00
vfs_default.c Introduce VOP_UNP_BIND(), VOP_UNP_CONNECT(), and VOP_UNP_DETACH() 2012-02-29 21:38:31 +00:00
vfs_export.c
vfs_extattr.c Fix found places where uio_resid is truncated to int. 2012-02-21 01:05:12 +00:00
vfs_hash.c
vfs_init.c
vfs_lookup.c
vfs_mount.c Decomission mnt_noasync. Introduce MNTK_NOASYNC mnt_kern_flag which 2012-03-09 00:12:05 +00:00
vfs_mountroot.c Fix found places where uio_resid is truncated to int. 2012-02-21 01:05:12 +00:00
vfs_subr.c Decomission mnt_noasync. Introduce MNTK_NOASYNC mnt_kern_flag which 2012-03-09 00:12:05 +00:00
vfs_syscalls.c Perform the parameter validation before assigning it to a signed int 2012-03-09 21:31:12 +00:00
vfs_vnops.c Add KTR_VFS traces to track modifications to a vnode's writecount. 2012-03-08 20:27:20 +00:00
vnode_if.src Introduce VOP_UNP_BIND(), VOP_UNP_CONNECT(), and VOP_UNP_DETACH() 2012-02-29 21:38:31 +00:00