Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Jul 2010 21:02:32 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r209831 - stable/8/sys/kern
Message-ID:  <201007082102.o68L2WSR026586@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Thu Jul  8 21:02:31 2010
New Revision: 209831
URL: http://svn.freebsd.org/changeset/base/209831

Log:
  MFC r209247: lock_profile_release_lock: do not compare unsigned with zero
  
  Note: no MFC to stable/7

Modified:
  stable/8/sys/kern/subr_lock.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/kern/subr_lock.c
==============================================================================
--- stable/8/sys/kern/subr_lock.c	Thu Jul  8 20:57:37 2010	(r209830)
+++ stable/8/sys/kern/subr_lock.c	Thu Jul  8 21:02:31 2010	(r209831)
@@ -600,7 +600,7 @@ lock_profile_release_lock(struct lock_ob
 	struct lock_profile_object *l;
 	struct lock_prof_type *type;
 	struct lock_prof *lp;
-	u_int64_t holdtime;
+	u_int64_t curtime, holdtime;
 	struct lpohead *head;
 	int spin;
 
@@ -628,9 +628,11 @@ lock_profile_release_lock(struct lock_ob
 	lp = lock_profile_lookup(lo, spin, l->lpo_file, l->lpo_line);
 	if (lp == NULL)
 		goto release;
-	holdtime = nanoseconds() - l->lpo_acqtime;
-	if (holdtime < 0)
+	curtime = nanoseconds();
+	if (curtime < l->lpo_acqtime)
 		goto release;
+	holdtime = curtime - l->lpo_acqtime;
+
 	/*
 	 * Record if the lock has been held longer now than ever
 	 * before.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201007082102.o68L2WSR026586>