diff options
author | mjg <mjg@FreeBSD.org> | 2017-03-14 20:43:04 +0000 |
---|---|---|
committer | mjg <mjg@FreeBSD.org> | 2017-03-14 20:43:04 +0000 |
commit | 3edf8a9d08485cf11c17af11e7852d41f8edea23 (patch) | |
tree | 3a52f54c3221a41c2827b86fcf9b8cfa4136dae9 /sys/sys/pmckern.h | |
parent | 57f28a25af7dd32fc8adea80c5ebb2b237cc86a6 (diff) | |
download | FreeBSD-src-3edf8a9d08485cf11c17af11e7852d41f8edea23.zip FreeBSD-src-3edf8a9d08485cf11c17af11e7852d41f8edea23.tar.gz |
MFC r312724,r312901,r312902:
hwpmc: partially depessimize munmap handling if the module is not loaded
HWPMC_HOOKS is enabled in GENERIC and triggers some work avoidable in the
common (module not loaded) case.
In particular this avoids permission checks + lock downgrade
singlethreaded and in cases were an executable mapping is found the pmc
sx lock is no longer bounced.
Note this is a band aid.
==
hwpmc: partially depessimize mmap handling if the module is not loaded
In particular this means the pmc sx lock is no longer taken when an
executable mapping succeeds.
==
hwpmc: annotate pmc_hook and pmc_intr as __read_mostly
Diffstat (limited to 'sys/sys/pmckern.h')
-rw-r--r-- | sys/sys/pmckern.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/sys/pmckern.h b/sys/sys/pmckern.h index 21b7ee7..dd197fd 100644 --- a/sys/sys/pmckern.h +++ b/sys/sys/pmckern.h @@ -174,6 +174,9 @@ extern const int pmc_kernel_version; /* PMC soft per cpu trapframe */ extern struct trapframe pmc_tf[MAXCPU]; +/* Quick check if preparatory work is necessary */ +#define PMC_HOOK_INSTALLED(cmd) __predict_false(pmc_hook != NULL) + /* Hook invocation; for use within the kernel */ #define PMC_CALL_HOOK(t, cmd, arg) \ do { \ |