freebsd-dev/sys/security/audit
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
..
audit_arg.c Update auditing of socket information for the inpcb new world order: 2007-02-20 13:38:11 +00:00
audit_bsm_klib.c Replace custom file descriptor array sleep lock constructed using a mutex 2007-04-04 09:11:34 +00:00
audit_bsm_token.c Update a number of comments: 2006-12-28 22:18:43 +00:00
audit_bsm.c Add BSM conversion switch entries for a number of system calls, many 2006-10-03 20:43:48 +00:00
audit_ioctl.h Allow the user process to query the kernel's notion of a maximum 2006-08-26 17:59:31 +00:00
audit_pipe.c Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
audit_private.h Change the type of ar_arg_sockaddr from struct sockaddr to struct 2006-11-06 00:15:44 +00:00
audit_syscalls.c Remove 'MPSAFE' annotations from the comments above most system calls: all 2007-03-04 22:36:48 +00:00
audit_trigger.c Update a number of comments: 2006-12-28 22:18:43 +00:00
audit_worker.c Update a number of comments: 2006-12-28 22:18:43 +00:00
audit.c Remove 'MPSAFE' annotations from the comments above most system calls: all 2007-03-04 22:36:48 +00:00
audit.h White space cleanup, no functional change. 2006-09-04 06:06:23 +00:00