summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorkmacy <kmacy@FreeBSD.org>2007-04-03 18:36:27 +0000
committerkmacy <kmacy@FreeBSD.org>2007-04-03 18:36:27 +0000
commit8913ddf2028bbfbe4187f38e239e59e610f259fa (patch)
tree12d5becde7bab1d4a8107410a5d67b5c76aaa06a /sys/kern
parent94fce13c41e11c01d5203ddd98deb2dab2589a04 (diff)
downloadFreeBSD-src-8913ddf2028bbfbe4187f38e239e59e610f259fa.zip
FreeBSD-src-8913ddf2028bbfbe4187f38e239e59e610f259fa.tar.gz
skip call to _lock_profile_obtain_lock_success entirely if acquisition time is non-zero
(i.e. recursing or adding sharers)
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/subr_lock.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/sys/kern/subr_lock.c b/sys/kern/subr_lock.c
index 8bd4431..dfbcb25 100644
--- a/sys/kern/subr_lock.c
+++ b/sys/kern/subr_lock.c
@@ -254,21 +254,18 @@ void _lock_profile_obtain_lock_success(struct lock_object *lo, int contested, ui
{
struct lock_profile_object *l = &lo->lo_profile_obj;
- /* don't reset the timer when/if recursing */
- if (l->lpo_acqtime == 0) {
- lo->lo_profile_obj.lpo_contest_holding = 0;
-
- if (contested)
- lo->lo_profile_obj.lpo_contest_locking++;
+ lo->lo_profile_obj.lpo_contest_holding = 0;
- l->lpo_filename = file;
- l->lpo_lineno = line;
- l->lpo_acqtime = nanoseconds();
- if (waittime && (l->lpo_acqtime > waittime))
- l->lpo_waittime = l->lpo_acqtime - waittime;
- else
- l->lpo_waittime = 0;
- }
+ if (contested)
+ lo->lo_profile_obj.lpo_contest_locking++;
+
+ l->lpo_filename = file;
+ l->lpo_lineno = line;
+ l->lpo_acqtime = nanoseconds();
+ if (waittime && (l->lpo_acqtime > waittime))
+ l->lpo_waittime = l->lpo_acqtime - waittime;
+ else
+ l->lpo_waittime = 0;
}
void _lock_profile_release_lock(struct lock_object *lo)
OpenPOWER on IntegriCloud