diff options
author | rwatson <rwatson@FreeBSD.org> | 2007-04-04 09:11:34 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2007-04-04 09:11:34 +0000 |
commit | 765a83fd795f79d2911ebf3b158ddc368ea0a0f6 (patch) | |
tree | 8805b4674ed3429ddf05f19fd5eb0813fb7884aa /usr.bin/logger | |
parent | 37016d3a5dbecc7b8ef5733b5f47471e3418f9ea (diff) | |
download | FreeBSD-src-765a83fd795f79d2911ebf3b158ddc368ea0a0f6.zip FreeBSD-src-765a83fd795f79d2911ebf3b158ddc368ea0a0f6.tar.gz |
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
Diffstat (limited to 'usr.bin/logger')
0 files changed, 0 insertions, 0 deletions