HomeFreeBSD

hwpmc: fix performance issues

Description

hwpmc: fix performance issues

Differential revision: https://reviews.freebsd.org/D32025

Avoid using atomics as it_wait is guarded by td_lock.

Report threshold calculation is done only if at least one PMC hook
is installed

Fixes:

  • avoid unnecessary branching (if frame != null ...) by having PMC_HOOK_INSTALLED_ANY condition on the top of them, which should hint the core not to execute speculatively anything which us underneath;
  • access intr_hwpmc_waiting_report_threshold cacheline only if at least one hook is loaded;

Details

Provenance
wmaAuthored on Sep 20 2021, 11:08 AM
Differential Revision
D32025: hwpmc: fix performance issues
Parents
rG319b15000300: pmc: intr pmc.soft(3) update
Branches
Unknown
Tags
Unknown