svn commit: r239591 - head/sys/sys

Jim Harris jimharris at FreeBSD.org
Wed Aug 22 20:22:55 UTC 2012


Author: jimharris
Date: Wed Aug 22 20:22:55 2012
New Revision: 239591
URL: http://svn.freebsd.org/changeset/base/239591

Log:
  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
  Reviewed by: jhb
  MFC after: 1 week

Modified:
  head/sys/sys/pmckern.h

Modified: head/sys/sys/pmckern.h
==============================================================================
--- head/sys/sys/pmckern.h	Wed Aug 22 20:07:10 2012	(r239590)
+++ head/sys/sys/pmckern.h	Wed Aug 22 20:22:55 2012	(r239591)
@@ -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)				\


More information about the svn-src-head mailing list