diff options
author | attilio <attilio@FreeBSD.org> | 2008-05-15 20:10:06 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2008-05-15 20:10:06 +0000 |
commit | f7f31164f19cdffc5fc75cde6ac6d025b796f980 (patch) | |
tree | 4a7012a0d4693359153827067b7671780eaffb71 /sys/kern/kern_sx.c | |
parent | 65c049483295f418e34fa09dc07b3656d53df907 (diff) | |
download | FreeBSD-src-f7f31164f19cdffc5fc75cde6ac6d025b796f980.zip FreeBSD-src-f7f31164f19cdffc5fc75cde6ac6d025b796f980.tar.gz |
- Embed the recursion counter for any locking primitive directly in the
lock_object, using an unified field called lo_data.
- Replace lo_type usage with the w_name usage and at init time pass the
lock "type" directly to witness_init() from the parent lock init
function. Handle delayed initialization before than
witness_initialize() is called through the witness_pendhelp structure.
- Axe out LO_ENROLLPEND as it is not really needed. The case where the
mutex init delayed wants to be destroyed can't happen because
witness_destroy() checks for witness_cold and panic in case.
- In enroll(), if we cannot allocate a new object from the freelist,
notify that to userspace through a printf().
- Modify the depart function in order to return nothing as in the current
CVS version it always returns true and adjust callers accordingly.
- Fix the witness_addgraph() argument name prototype.
- Remove unuseful code from itismychild().
This commit leads to a shrinked struct lock_object and so smaller locks,
in particular on amd64 where 2 uintptr_t (16 bytes per-primitive) are
gained.
Reviewed by: jhb
Diffstat (limited to 'sys/kern/kern_sx.c')
-rw-r--r-- | sys/kern/kern_sx.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/kern/kern_sx.c b/sys/kern/kern_sx.c index 37cb00a..1f0011c 100644 --- a/sys/kern/kern_sx.c +++ b/sys/kern/kern_sx.c @@ -101,6 +101,7 @@ CTASSERT(((SX_ADAPTIVESPIN | SX_RECURSE) & LO_CLASSFLAGS) == * Returns true if an exclusive lock is recursed. It assumes * curthread currently has an exclusive lock. */ +#define sx_recurse lock_object.lo_data #define sx_recursed(sx) ((sx)->sx_recurse != 0) static void assert_sx(struct lock_object *lock, int what); |