aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKip Macy <kmacy@FreeBSD.org>2007-04-03 17:57:50 +0000
committerKip Macy <kmacy@FreeBSD.org>2007-04-03 17:57:50 +0000
commit802d9610ebc5e6397345943ccff37a6967d82643 (patch)
tree534f48cd2433feafcdc92140ed56ded97780d595
parent5de699ca22b676092a6ca3ecb436124504336cc4 (diff)
downloadsrc-802d9610ebc5e6397345943ccff37a6967d82643.tar.gz
src-802d9610ebc5e6397345943ccff37a6967d82643.zip
Remove unneccessary LO_CONTESTED flag
Notes
Notes: svn path=/head/; revision=168310
-rw-r--r--sys/sys/lock.h1
-rw-r--r--sys/sys/lock_profile.h15
2 files changed, 6 insertions, 10 deletions
diff --git a/sys/sys/lock.h b/sys/sys/lock.h
index 1c9940c46070..6d35ce58be32 100644
--- a/sys/sys/lock.h
+++ b/sys/sys/lock.h
@@ -79,7 +79,6 @@ struct lock_class {
#define LO_ENROLLPEND 0x00800000 /* On the pending enroll list. */
#define LO_CLASSMASK 0x0f000000 /* Class index bitmask. */
#define LO_NOPROFILE 0x10000000 /* Don't profile this lock */
-#define LO_CONTESTED 0x20000000 /* Lock was contested */
/*
* Lock classes are statically assigned an index into the gobal lock_classes
diff --git a/sys/sys/lock_profile.h b/sys/sys/lock_profile.h
index 4b1dc504303a..91f303206635 100644
--- a/sys/sys/lock_profile.h
+++ b/sys/sys/lock_profile.h
@@ -122,7 +122,6 @@ static inline void lock_profile_obtain_lock_failed(struct lock_object *lo, int *
if (lock_prof_enable && *contested == 0) {
*waittime = nanoseconds();
- lo->lo_flags |= LO_CONTESTED;
atomic_add_int(&l->lpo_contest_holding, 1);
*contested = 1;
}
@@ -131,21 +130,19 @@ static inline void lock_profile_obtain_lock_failed(struct lock_object *lo, int *
static inline void lock_profile_obtain_lock_success(struct lock_object *lo, int contested, uint64_t waittime, const char *file, int line)
{
if (lock_prof_enable) {
+#ifdef LOCK_PROFILING_FAST
+ if (contested == 0)
+ return;
+#endif
_lock_profile_obtain_lock_success(lo, contested, waittime, file, line);
}
}
-
static inline void lock_profile_release_lock(struct lock_object *lo)
{
struct lock_profile_object *l = &lo->lo_profile_obj;
-#ifdef LOCK_PROFILING_FAST
- if((lo->lo_flags & LO_CONTESTED) == 0)
- return;
-#endif
- if (lock_prof_enable || l->lpo_acqtime) {
- lo->lo_flags &= ~LO_CONTESTED;
+
+ if (l->lpo_acqtime)
_lock_profile_release_lock(lo);
- }
}
#else /* !LOCK_PROFILING */