summaryrefslogtreecommitdiffstats
path: root/sys/sys/pmckern.h
diff options
context:
space:
mode:
authorjimharris <jimharris@FreeBSD.org>2012-08-22 20:22:55 +0000
committerjimharris <jimharris@FreeBSD.org>2012-08-22 20:22:55 +0000
commita49bdc9a252d8c144ed4c8d040b34a1e2ce6e653 (patch)
tree4d371bc1b95315baf3235a48ed3c94ff639228a5 /sys/sys/pmckern.h
parent9d2e20143f198869149c9e2dc114da6153f2df12 (diff)
downloadFreeBSD-src-a49bdc9a252d8c144ed4c8d040b34a1e2ce6e653.zip
FreeBSD-src-a49bdc9a252d8c144ed4c8d040b34a1e2ce6e653.tar.gz
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
Diffstat (limited to 'sys/sys/pmckern.h')
-rw-r--r--sys/sys/pmckern.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/sys/pmckern.h b/sys/sys/pmckern.h
index 44f1916..c623648 100644
--- a/sys/sys/pmckern.h
+++ b/sys/sys/pmckern.h
@@ -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) \
OpenPOWER on IntegriCloud