freebsd-skq/sys/compat/svr4
rwatson 765a83fd79 Replace custom file descriptor array sleep lock constructed using a mutex
and flags with an sxlock.  This leads to a significant and measurable
performance improvement as a result of access to shared locking for
frequent lookup operations, reduced general overhead, and reduced overhead
in the event of contention.  All of these are imported for threaded
applications where simultaneous access to a shared file descriptor array
occurs frequently.  Kris has reported 2x-4x transaction rate improvements
on 8-core MySQL benchmarks; smaller improvements can be expected for many
workloads as a result of reduced overhead.

- Generally eliminate the distinction between "fast" and regular
  acquisisition of the filedesc lock; the plan is that they will now all
  be fast.  Change all locking instances to either shared or exclusive
  locks.

- Correct a bug (pointed out by kib) in fdfree() where previously msleep()
  was called without the mutex held; sx_sleep() is now always called with
  the sxlock held exclusively.

- Universally hold the struct file lock over changes to struct file,
  rather than the filedesc lock or no lock.  Always update the f_ops
  field last. A further memory barrier is required here in the future
  (discussed with jhb).

- Improve locking and reference management in linux_at(), which fails to
  properly acquire vnode references before using vnode pointers.  Annotate
  improper use of vn_fullpath(), which will be replaced at a future date.

In fcntl(), we conservatively acquire an exclusive lock, even though in
some cases a shared lock may be sufficient, which should be revisited.
The dropping of the filedesc lock in fdgrowtable() is no longer required
as the sxlock can be held over the sleep operation; we should consider
removing that (pointed out by attilio).

Tested by:	kris
Discussed with:	jhb, kris, attilio, jeff
2007-04-04 09:11:34 +00:00
..
imgact_svr4.c - Change the vm_mmap() function to accept an objtype_t parameter specifying 2005-04-01 20:00:11 +00:00
Makefile Housekeeping. Update for maintainers who have handed in their commit bits 2006-07-01 10:51:55 +00:00
svr4_acl.h Start each of the license/copyright comments with /*- 2005-01-05 22:34:37 +00:00
svr4_dirent.h Start each of the license/copyright comments with /*- 2005-01-05 22:34:37 +00:00
svr4_errno.h Start each of the license/copyright comments with /*- 2005-01-05 22:34:37 +00:00
svr4_exec.h Start each of the license/copyright comments with /*- 2005-01-05 22:34:37 +00:00
svr4_fcntl.c Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
svr4_fcntl.h Start each of the license/copyright comments with /*- 2005-01-05 22:34:37 +00:00
svr4_filio.c Replace custom file descriptor array sleep lock constructed using a mutex 2007-04-04 09:11:34 +00:00
svr4_filio.h Start each of the license/copyright comments with /*- 2005-01-05 22:34:37 +00:00
svr4_fuser.h Start each of the license/copyright comments with /*- 2005-01-05 22:34:37 +00:00
svr4_hrt.h Start each of the license/copyright comments with /*- 2005-01-05 22:34:37 +00:00
svr4_ioctl.c Back out alpha/alpha/trap.c:1.124, osf1_ioctl.c:1.14, osf1_misc.c:1.57, 2005-09-28 07:03:03 +00:00
svr4_ioctl.h Start each of the license/copyright comments with /*- 2005-01-05 22:34:37 +00:00
svr4_ipc.c Rework kern_semctl a bit to always assume the UIO_SYSSPACE case. This 2006-07-08 19:51:38 +00:00
svr4_ipc.h Start each of the license/copyright comments with /*- 2005-01-05 22:34:37 +00:00
svr4_misc.c Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
svr4_mman.h Start each of the license/copyright comments with /*- 2005-01-05 22:34:37 +00:00
svr4_proto.h Regen. 2006-11-11 21:49:08 +00:00
svr4_resource.c Start each of the license/copyright comments with /*- 2005-01-05 22:34:37 +00:00
svr4_resource.h Start each of the license/copyright comments with /*- 2005-01-05 22:34:37 +00:00
svr4_siginfo.h Fix compiling problem by adding prefix name svr4 to si_xxx macro, the 2005-10-19 09:33:15 +00:00
svr4_signal.c Back out alpha/alpha/trap.c:1.124, osf1_ioctl.c:1.14, osf1_misc.c:1.57, 2005-09-28 07:03:03 +00:00
svr4_signal.h 1. Change prototype of trapsignal and sendsig to use ksiginfo_t *, most 2005-10-14 12:43:47 +00:00
svr4_socket.c Clean up the svr4 socket cache and streams code some to make it more easily 2006-07-21 20:40:13 +00:00
svr4_socket.h Clean up the svr4 socket cache and streams code some to make it more easily 2006-07-21 20:40:13 +00:00
svr4_sockio.c Use TAILQ_EMPTY instead of checking if TAILQ_FIRST is NULL. 2006-08-04 21:15:09 +00:00
svr4_sockio.h Start each of the license/copyright comments with /*- 2005-01-05 22:34:37 +00:00
svr4_sockmod.h Start each of the license/copyright comments with /*- 2005-01-05 22:34:37 +00:00
svr4_stat.c Remove two hypothetical calls to suser() in ifdef'd (and uncompilable) 2006-09-02 08:18:22 +00:00
svr4_stat.h Start each of the license/copyright comments with /*- 2005-01-05 22:34:37 +00:00
svr4_statvfs.h Start each of the license/copyright comments with /*- 2005-01-05 22:34:37 +00:00
svr4_stream.c With socket code no longer in svr4_stream.c, MAC includes are no longer 2006-08-05 22:04:21 +00:00
svr4_stropts.h - Explicitly lock Giant to protect the fields in the svr4_strm structure 2006-07-28 16:56:17 +00:00
svr4_syscall.h Regen for MPSAFE flag removal. 2006-07-28 19:08:37 +00:00
svr4_syscallnames.c Regen for MPSAFE flag removal. 2006-07-28 19:08:37 +00:00
svr4_sysconfig.h Start each of the license/copyright comments with /*- 2005-01-05 22:34:37 +00:00
svr4_sysent.c Regen to propogate <prefix>_AUE_<mumble> changes as well as the earlier 2006-08-15 17:37:01 +00:00
svr4_systeminfo.h Start each of the license/copyright comments with /*- 2005-01-05 22:34:37 +00:00
svr4_sysvec.c Clean up the svr4 socket cache and streams code some to make it more easily 2006-07-21 20:40:13 +00:00
svr4_termios.c Back out alpha/alpha/trap.c:1.124, osf1_ioctl.c:1.14, osf1_misc.c:1.57, 2005-09-28 07:03:03 +00:00
svr4_termios.h Start each of the license/copyright comments with /*- 2005-01-05 22:34:37 +00:00
svr4_time.h Start each of the license/copyright comments with /*- 2005-01-05 22:34:37 +00:00
svr4_timod.h Start each of the license/copyright comments with /*- 2005-01-05 22:34:37 +00:00
svr4_ttold.c Back out alpha/alpha/trap.c:1.124, osf1_ioctl.c:1.14, osf1_misc.c:1.57, 2005-09-28 07:03:03 +00:00
svr4_ttold.h Start each of the license/copyright comments with /*- 2005-01-05 22:34:37 +00:00
svr4_types.h Start each of the license/copyright comments with /*- 2005-01-05 22:34:37 +00:00
svr4_ucontext.h Start each of the license/copyright comments with /*- 2005-01-05 22:34:37 +00:00
svr4_ulimit.h Start each of the license/copyright comments with /*- 2005-01-05 22:34:37 +00:00
svr4_ustat.h Start each of the license/copyright comments with /*- 2005-01-05 22:34:37 +00:00
svr4_util.h - Split out kern_accept(), kern_getpeername(), and kern_getsockname() for 2006-07-10 21:38:17 +00:00
svr4_utsname.h Start each of the license/copyright comments with /*- 2005-01-05 22:34:37 +00:00
svr4_wait.h Start each of the license/copyright comments with /*- 2005-01-05 22:34:37 +00:00
svr4.h - Stop hardcoding #define's for options and use the appropriate 2005-07-13 15:14:33 +00:00
syscalls.conf - Remove unused sysvec variables from various syscalls.conf. 2006-08-15 17:25:55 +00:00
syscalls.master Now that all system calls are MPSAFE, retire the SYF_MPSAFE flag used to 2006-07-28 19:05:28 +00:00