Date: Mon, 23 Dec 2013 17:52:01 +0000 From: "Rang, Anton" <anton.rang@isilon.com> To: "freebsd-current@freebsd.org" <freebsd-current@freebsd.org> Subject: A tweak to HWPMC hooks to improve code generation Message-ID: <F21EDC44C64DB34B90AF485AC3CEDD4B27F9DE7B@MX104CL01.corp.emc.com>
index | next in thread | raw e-mail
[-- Attachment #1 --]
The HWPMC hooks are never invoked except when using the soft PMC feature for performance monitoring. This trivial patch hints as much to the compiler, which then moves some fairly lengthy code sequences out of the locking primitives (in particular), reducing their runtime footprint.
This patch was reviewed by Attilio Rao.
Anton
[-- Attachment #2 --]
Index: sys/sys/pmckern.h
===================================================================
--- sys/sys/pmckern.h (revision 259665)
+++ sys/sys/pmckern.h (working copy)
@@ -110,7 +110,7 @@
#ifdef PMC_FAKE_TRAPFRAME
#define PMC_SOFT_CALL(pr, mo, fu, na) \
do { \
- if (pmc_##pr##_##mo##_##fu##_##na.ps_running) { \
+ if (__predict_false(pmc_##pr##_##mo##_##fu##_##na.ps_running)) { \
struct pmckern_soft ks; \
register_t intr; \
intr = intr_disable(); \
@@ -135,7 +135,7 @@
*/
#define PMC_SOFT_CALL_TF(pr, mo, fu, na, tf) \
do { \
- if (pmc_##pr##_##mo##_##fu##_##na.ps_running) { \
+ if (__predict_false(pmc_##pr##_##mo##_##fu##_##na.ps_running)) { \
struct pmckern_soft ks; \
register_t intr; \
intr = intr_disable(); \
home |
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F21EDC44C64DB34B90AF485AC3CEDD4B27F9DE7B>
