Date: Thu, 4 Apr 2002 11:07:27 -0800 (PST) From: John Baldwin <jhb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 9041 for review Message-ID: <200204041907.g34J7RJ22362@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=9041 Change 9041 by jhb@jhb_laptop on 2002/04/04 11:06:53 Integ from jhb_lock: - Change witness to use lock->lo_type instead of lock->lo_name for its lookups. - Fixup mutex and sx code accordingly. Affected files ... ... //depot/projects/smpng/sys/kern/kern_mutex.c#25 integrate ... //depot/projects/smpng/sys/kern/kern_sx.c#16 integrate ... //depot/projects/smpng/sys/kern/subr_witness.c#39 integrate ... //depot/projects/smpng/sys/sys/_lock.h#6 integrate ... //depot/projects/smpng/sys/sys/mutex.h#24 integrate Differences ... ==== //depot/projects/smpng/sys/kern/kern_mutex.c#25 (text+ko) ==== @@ -794,10 +794,12 @@ /* * Mutex initialization routine; initialize lock `m' of type contained in - * `opts' with options contained in `opts' and description `description.' + * `opts' with options contained in `opts' and name `name.' The optional + * lock type `type' is used as a general lock category name for use with + * witness. */ void -mtx_init(struct mtx *m, const char *description, int opts) +mtx_init(struct mtx *m, const char *name, const char *type, int opts) { struct lock_object *lock; @@ -817,7 +819,8 @@ lock->lo_class = &lock_class_mtx_spin; else lock->lo_class = &lock_class_mtx_sleep; - lock->lo_name = description; + lock->lo_name = name; + lock->lo_type = type != NULL ? type : name; if (opts & MTX_QUIET) lock->lo_flags = LO_QUIET; if (opts & MTX_RECURSE) ==== //depot/projects/smpng/sys/kern/kern_sx.c#16 (text+ko) ==== @@ -70,7 +70,7 @@ ("sx lock %s %p already initialized", description, sx)); bzero(sx, sizeof(*sx)); lock->lo_class = &lock_class_sx; - lock->lo_name = description; + lock->lo_type = lock->lo_name = description; lock->lo_flags = LO_WITNESS | LO_RECURSABLE | LO_SLEEPABLE | LO_UPGRADABLE; sx->sx_lock = mtx_pool_find(sx); ==== //depot/projects/smpng/sys/kern/subr_witness.c#39 (text+ko) ==== @@ -311,7 +311,7 @@ mtx_lock(&all_mtx); STAILQ_FOREACH(lock, &all_locks, lo_list) { if (lock->lo_flags & LO_WITNESS) - lock->lo_witness = enroll(lock->lo_name, + lock->lo_witness = enroll(lock->lo_type, lock->lo_class); else lock->lo_witness = NULL; @@ -356,7 +356,7 @@ mtx_unlock(&all_mtx); if (!witness_cold && !witness_dead && panicstr == NULL && (lock->lo_flags & LO_WITNESS) != 0) - lock->lo_witness = enroll(lock->lo_name, class); + lock->lo_witness = enroll(lock->lo_type, class); else lock->lo_witness = NULL; } ==== //depot/projects/smpng/sys/sys/_lock.h#6 (text+ko) ==== @@ -33,7 +33,8 @@ struct lock_object { struct lock_class *lo_class; - const char *lo_name; + const char *lo_name; /* Individual lock name. */ + const char *lo_type; /* General lock type. */ u_int lo_flags; STAILQ_ENTRY(lock_object) lo_list; /* List of all locks in system. */ struct witness *lo_witness; ==== //depot/projects/smpng/sys/sys/mutex.h#24 (text+ko) ==== @@ -97,7 +97,7 @@ * [See below for descriptions] * */ -void mtx_init(struct mtx *m, const char *description, int opts); +void mtx_init(struct mtx *m, const char *name, const char *type, int opts); void mtx_destroy(struct mtx *m); void mtx_sysinit(void *arg); void mutex_init(void); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200204041907.g34J7RJ22362>