freebsd-skq/sys/netsmb
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
..
netbios.h Allow user to override default port numbers used by communication 2005-10-02 08:32:49 +00:00
smb_conn.c Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
smb_conn.h
smb_crypt.c Fix misalignment bugs caused by invalid type casts of pointers 2006-08-22 03:05:51 +00:00
smb_dev.c Replace custom file descriptor array sleep lock constructed using a mutex 2007-04-04 09:11:34 +00:00
smb_dev.h
smb_iod.c Fix misalignment bugs caused by invalid type casts of pointers 2006-08-22 03:05:51 +00:00
smb_rq.c Fix misalignment bugs caused by invalid type casts of pointers 2006-08-22 03:05:51 +00:00
smb_rq.h Fix misalignment bugs caused by invalid type casts of pointers 2006-08-22 03:05:51 +00:00
smb_smb.c Retire NETSMBCRYPTO as a kernel option and make its functionality 2006-03-05 22:52:17 +00:00
smb_subr.c It seems to be safe to ignore 'file not locked' error 2006-11-05 06:31:08 +00:00
smb_subr.h Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
smb_tran.h
smb_trantcp.c - Fix ncp_poll() to not panic if the socket doesn't have any pending data. 2006-08-03 15:31:52 +00:00
smb_trantcp.h
smb_usr.c
smb.h