freebsd-nq/sys/compat/linux
Robert Watson 5e3f7694b1 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
..
linux_emul.c MFP4: Turn emul_lock into a mutex. 2007-04-02 18:38:13 +00:00
linux_emul.h MFP4: Turn emul_lock into a mutex. 2007-04-02 18:38:13 +00:00
linux_file.c Replace custom file descriptor array sleep lock constructed using a mutex 2007-04-04 09:11:34 +00:00
linux_futex.c MFP4: Linux futex support for amd64. 2007-03-30 01:07:28 +00:00
linux_futex.h MFp4 (110523, parts which apply cleanly): 2007-02-25 12:40:35 +00:00
linux_getcwd.c Add missed ")". Fix the build. 2006-11-18 17:27:39 +00:00
linux_ioctl.c - Protect the list of linux ioctl handlers with an sx lock. 2006-07-06 21:42:36 +00:00
linux_ioctl.h Now that we don't have a linuxolator on alpha anymore: 2006-05-10 20:38:16 +00:00
linux_ipc.c MFp4 (112379): 2007-01-14 16:34:43 +00:00
linux_ipc.h MFP4 (110956): 2006-12-21 13:11:06 +00:00
linux_mib.c MFp4 (112705): 2007-01-14 16:07:01 +00:00
linux_mib.h MFp4 (111746+): 2006-12-31 12:39:10 +00:00
linux_misc.c Partial MFp4 of 114977: 2007-02-24 16:49:25 +00:00
linux_misc.h MFp4: 2006-12-31 11:56:16 +00:00
linux_signal.c MFp4 (112534): 2007-01-07 19:14:06 +00:00
linux_signal.h MFP4 (107868 - 107870): 2006-10-15 12:51:43 +00:00
linux_socket.c Introduce some more SO_ option equivalents from Linux to FreeBSD. 2007-02-01 13:36:19 +00:00
linux_socket.h
linux_stats.c In translate_path_major_minor(), do not calculate otherwise unused 'fp' 2007-03-06 07:39:12 +00:00
linux_sysctl.c Unbreak COMPAT_LINUX32 option support on amd64. 2006-03-19 11:10:33 +00:00
linux_sysproto.h Handle unimplemented syscall by instantly returning ENOSYS instead of sending 2005-03-07 00:18:06 +00:00
linux_time.c MFP4: 109655 2006-12-20 20:17:35 +00:00
linux_uid16.c Partial MFp4 of 114977: 2007-02-24 16:49:25 +00:00
linux_util.c Partial MFp4 of 114977: 2007-02-24 16:49:25 +00:00
linux_util.h Implement the openat() linux syscall 2007-03-29 02:11:46 +00:00