From owner-svn-src-all@freebsd.org Mon Jul 31 00:59:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9D4DDC61B1; Mon, 31 Jul 2017 00:59:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5BC702241; Mon, 31 Jul 2017 00:59:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6V0xSWl040028; Mon, 31 Jul 2017 00:59:28 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V0xSU1040027; Mon, 31 Jul 2017 00:59:28 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201707310059.v6V0xSU1040027@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 31 Jul 2017 00:59:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321744 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 321744 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jul 2017 00:59:29 -0000 Author: markj Date: Mon Jul 31 00:59:28 2017 New Revision: 321744 URL: https://svnweb.freebsd.org/changeset/base/321744 Log: Correct the predicates on which lockstat:::{thread,spin}-spin fire. In particular, they should fire only if the lock was owned by another thread when we first attempted to acquire that lock. MFC after: 1 week Modified: head/sys/kern/kern_mutex.c Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Mon Jul 31 00:54:50 2017 (r321743) +++ head/sys/kern/kern_mutex.c Mon Jul 31 00:59:28 2017 (r321744) @@ -766,7 +766,7 @@ _mtx_lock_spin_cookie(volatile uintptr_t *c, uintptr_t LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(spin__acquire, m, contested, waittime, file, line); #ifdef KDTRACE_HOOKS - if (spin_time != 0) + if (lda.spin_cnt != 0) LOCKSTAT_RECORD1(spin__spin, m, spin_time); #endif } @@ -879,7 +879,7 @@ retry: LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(spin__acquire, m, contested, waittime, file, line); #ifdef KDTRACE_HOOKS - if (spin_time != 0) + if (lda.spin_cnt != 0) LOCKSTAT_RECORD1(thread__spin, m, spin_time); #endif }