Page MenuHomeFreeBSD

Improvements to HWPMC support on FreeBSD/arm64 to handle counter wraparound
AbandonedPublic

Authored by rwatson on Jan 3 2021, 9:27 PM.

Details

Reviewers
andrew
br
gnn
Summary

Starting with a patch from Andrew Turner and Ruslan Bukin to improve HWPMC support for ARMv8-A counter wraparound:

  • Move to per-CPU overflow entries, since we model these as 32-bit extensions to 32-bit per-CPU registers.
  • Attempt to address a race between overflow counting and overflows, which may occur (for example) if the overflow happens while interrupts are off during context switching.

With these changes, I no longer experience panics when using per-process
counters on a multithreaded process.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 35913
Build 32802: arc lint + arc unit

Event Timeline

rwatson retitled this revision from Starting with a patch from Andrew Turner and Ruslan Bukin to improve HWPMC support for ARMv8-A counter wraparound: to Starting with a patch from Andrew Turner and Ruslan Bukin to improve HWPMCsupport for ARMv8-A counter wraparound:.Jan 3 2021, 9:28 PM
rwatson changed the repository for this revision from rS FreeBSD src repository - subversion to R10 FreeBSD src repository.
rwatson added a project: arm64.
rwatson retitled this revision from Starting with a patch from Andrew Turner and Ruslan Bukin to improve HWPMCsupport for ARMv8-A counter wraparound: to Improvements to HWPMC support on FreeBSD/arm64 to handle counter wraparound.
rwatson edited the summary of this revision. (Show Details)
sys/dev/hwpmc/hwpmc_arm64.c
235

Why is this per-CPU? pm should already be per-CPU from arm64_pcpu[cpu]

I think we now handle this with my recent commits.

A modified version of this merged in recent changes by @andrew.