From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 01:04:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B306106564A; Wed, 29 Aug 2012 01:04:13 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DFC268FC08; Wed, 29 Aug 2012 01:04:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7T14Cke057370; Wed, 29 Aug 2012 01:04:12 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7T14CcR057368; Wed, 29 Aug 2012 01:04:12 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201208290104.q7T14CcR057368@svn.freebsd.org> From: Jim Harris Date: Wed, 29 Aug 2012 01:04:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239798 - stable/9/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Wed, 29 Aug 2012 01:04:13 -0000 Author: jimharris Date: Wed Aug 29 01:04:12 2012 New Revision: 239798 URL: http://svn.freebsd.org/changeset/base/239798 Log: MFC r239591: Remove unncessary atomic operation when reading process flags in PMC_PROC_IS_USING_PMCS macro. Invocations of this macro are not synchronized with setting/clearing of P_HWPMC flag, so the atomic operation here isn't needed. Removing the atomic operation provides noticeable improvement (5-6%) on some scheduler-intensive workloads with HWPMC_HOOKS enabled on an 8C Sandy Bridge Xeon system. Sponsored by: Intel Modified: stable/9/sys/sys/pmckern.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/sys/pmckern.h ============================================================================== --- stable/9/sys/sys/pmckern.h Wed Aug 29 00:53:58 2012 (r239797) +++ stable/9/sys/sys/pmckern.h Wed Aug 29 01:04:12 2012 (r239798) @@ -201,8 +201,7 @@ do { \ /* Check if a process is using HWPMCs.*/ #define PMC_PROC_IS_USING_PMCS(p) \ - (__predict_false(atomic_load_acq_int(&(p)->p_flag) & \ - P_HWPMC)) + (__predict_false(p->p_flag & P_HWPMC)) /* Check if a thread have pending user capture. */ #define PMC_IS_PENDING_CALLCHAIN(p) \