1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-03 12:35:02 +00:00
freebsd/sys
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
..
amd64 MFP4: Turn emul_lock into a mutex. 2007-04-02 18:38:13 +00:00
arm Don't expose the uart_ops structure directly, but instead have 2007-04-02 22:00:22 +00:00
boot Loop on sdcard init. This helps if one hasn't plugged in the card 2007-04-02 20:26:04 +00:00
bsm
cam A silly buglet found by Coverity- check the return value from 2007-03-15 06:42:54 +00:00
coda Make insmntque() externally visibile and allow it to fail (e.g. during 2007-03-13 01:50:27 +00:00
compat Replace custom file descriptor array sleep lock constructed using a mutex 2007-04-04 09:11:34 +00:00
conf Temporarily desupport simultaneous target and initiator mode. 2007-04-02 01:04:20 +00:00
contrib Add an interface for drivers to be notified of changes to CPU frequency. 2007-03-26 18:03:29 +00:00
crypto Overhaul driver/subsystem api's: 2007-03-21 03:42:51 +00:00
ddb
dev Replace custom file descriptor array sleep lock constructed using a mutex 2007-04-04 09:11:34 +00:00
fs Replace custom file descriptor array sleep lock constructed using a mutex 2007-04-04 09:11:34 +00:00
gdb
geom - Be more verbose when saying "foo" not found. 2007-03-30 16:32:08 +00:00
gnu Change #include <machine/pcpu.h> to #include <sys/pcpu.h> 2007-04-01 12:48:10 +00:00
i4b Tell the user when the setup of the interrupt handler failed and return 2007-04-01 16:52:54 +00:00
i386 MFP4: Turn emul_lock into a mutex. 2007-04-02 18:38:13 +00:00
ia64 Catch up with ACPI-CA 20070320 import. 2007-03-22 18:16:43 +00:00
isa Partial fix for a bug in rev.1.231. If suspend/resume clobbers the 2007-03-05 09:10:17 +00:00
kern Replace custom file descriptor array sleep lock constructed using a mutex 2007-04-04 09:11:34 +00:00
libkern
modules oops, another missed file from crypto api change 2007-03-31 23:15:11 +00:00
net Fix regression in rev. 1.140. 2007-03-27 19:36:12 +00:00
net80211 change ic_modecaps to a bit vector and use setbit, et. al. 2007-03-11 22:37:32 +00:00
netatalk Use privilege PRIV_NET_ADDIFADDR rather than suser() to authorize 2007-02-19 22:40:02 +00:00
netatm Fix use after free bug: use temporary variable to hold next entry in linked 2007-04-03 12:45:10 +00:00
netgraph We don't need spinning locks here. Change them to the adaptive mutexes. This 2007-03-31 15:43:06 +00:00
netinet Include string.h for non-kernel builds to get proper memcpy prototype. 2007-04-04 03:16:59 +00:00
netinet6 - fixed several places where we did not release INP locks. 2007-04-03 11:15:32 +00:00
netipsec add include now required for crypto flags 2007-03-22 22:25:25 +00:00
netipx Build ipx_ip.c only if options IPXIP is defined. No functional change. 2007-02-26 11:55:34 +00:00
netkey
netnatm
netncp Use pause() rather than tsleep() on stack variables and function pointers. 2007-02-27 17:23:29 +00:00
netsmb Replace custom file descriptor array sleep lock constructed using a mutex 2007-04-04 09:11:34 +00:00
nfs
nfs4client Rename some functions and variables from nfs_* to nfs4_* to avoid 2007-01-25 14:33:13 +00:00
nfsclient Don't destroy a mutex just before we use it, instead, 2007-03-23 08:52:36 +00:00
nfsserver - Split out the part of SYSCALL_MODULE_HELPER() that builds a 'struct 2007-04-02 13:53:26 +00:00
opencrypto Replace custom file descriptor array sleep lock constructed using a mutex 2007-04-04 09:11:34 +00:00
pc98 Don't call bus_deactivate_resource() explicitly before calling 2007-03-21 03:38:37 +00:00
pccard
pci Add new ST201 PCI id. 2007-03-10 03:10:34 +00:00
powerpc If nooption SMP on powerpc, also nooption ADAPTIVE_SX, which depends on 2007-04-01 11:10:16 +00:00
rpc Replace GIANT_REQUIRED's present for socket locking with NET_LOCK_GIANT(). 2007-03-25 21:44:24 +00:00
security Replace custom file descriptor array sleep lock constructed using a mutex 2007-04-04 09:11:34 +00:00
sparc64 Push down the implementation of PCPU_LAZY_INC() into the machine-dependent 2007-03-11 05:54:29 +00:00
sun4v Push down the implementation of PCPU_LAZY_INC() into the machine-dependent 2007-03-11 05:54:29 +00:00
sys Replace custom file descriptor array sleep lock constructed using a mutex 2007-04-04 09:11:34 +00:00
tools Catch up with ACPI-CA 20070320 import. 2007-03-22 18:16:43 +00:00
ufs Use *_EMPTY macros when appropriate. 2007-04-04 07:29:53 +00:00
vm Prevent a race between vm_object_collapse() and vm_object_split() from 2007-03-27 08:55:17 +00:00
Makefile o Remove isofs from the cscope dirs list. Its content was 2007-03-24 22:21:01 +00:00