diff options
author | Attilio Rao <attilio@FreeBSD.org> | 2008-05-15 20:10:06 +0000 |
---|---|---|
committer | Attilio Rao <attilio@FreeBSD.org> | 2008-05-15 20:10:06 +0000 |
commit | 90356491d7c1d6bf64068ece7ea715f10a583a87 (patch) | |
tree | 4a7012a0d4693359153827067b7671780eaffb71 /sys/kern/subr_lock.c | |
parent | 6a9d52f375714b2e46c5e1293ddaa54608669981 (diff) |
- 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
Notes
Notes:
svn path=/head/; revision=179025
Diffstat (limited to 'sys/kern/subr_lock.c')
-rw-r--r-- | sys/kern/subr_lock.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/sys/kern/subr_lock.c b/sys/kern/subr_lock.c index 74a4148e9de4..3dd5ad710b5a 100644 --- a/sys/kern/subr_lock.c +++ b/sys/kern/subr_lock.c @@ -89,10 +89,9 @@ lock_init(struct lock_object *lock, struct lock_class *class, const char *name, /* Initialize the lock object. */ lock->lo_name = name; - lock->lo_type = type != NULL ? type : name; lock->lo_flags |= flags | LO_INITIALIZED; LOCK_LOG_INIT(lock, 0); - WITNESS_INIT(lock); + WITNESS_INIT(lock, (type != NULL) ? type : name); } void @@ -121,8 +120,6 @@ DB_SHOW_COMMAND(lock, db_show_lock) class = LOCK_CLASS(lock); db_printf(" class: %s\n", class->lc_name); db_printf(" name: %s\n", lock->lo_name); - if (lock->lo_type && lock->lo_type != lock->lo_name) - db_printf(" type: %s\n", lock->lo_type); class->lc_ddb_show(lock); } #endif |