freebsd-nq/sys/cddl
Ryan Stone 6969ef6656 Correct a series of errors in the hand-rolled locking for drace_debug.c:
- Use spinlock_enter()/spinlock_exit() to prevent a thread holding a
  debug lock from being preempted to prevent other threads waiting
  on that lock from starvation.

- Handle the possibility of CPU migration in between the fetch of curcpu
  and the call to spinlock_enter() by saving curcpu in a local variable.

- Use memory barriers to prevent reordering of loads and stores of the
  data protected by the lock outside of the critical section

- Eliminate false sharing of the locks by moving them into the structures
  that they protect and aligning them to a cacheline boundary.

- Record the owning thread in the lock to make debugging future problems
  easier.

Reviewed by:	rpaulo (initial version)
MFC after:	2 weeks
2012-12-23 15:50:37 +00:00
..
boot/zfs forgotten file from r240346 2012-09-11 08:45:49 +00:00
compat/opensolaris Renamed zfs trim stats removing duplicate zio_trim identifier from the name 2012-12-12 16:14:14 +00:00
contrib/opensolaris Added vfs.zfs.vdev.trim_on_init sysctl which allows full vdev trim on 2012-12-13 17:39:07 +00:00
dev Correct a series of errors in the hand-rolled locking for drace_debug.c: 2012-12-23 15:50:37 +00:00