Page MenuHomeFreeBSD

D61449.1794529557.diff
No OneTemporary

Authored By
Unknown
Size
702 B
Referenced Files
None
Subscribers
None

D61449.1794529557.diff

diff --git a/sys/dev/hwpmc/hwpmc_mod.c b/sys/dev/hwpmc/hwpmc_mod.c
--- a/sys/dev/hwpmc/hwpmc_mod.c
+++ b/sys/dev/hwpmc/hwpmc_mod.c
@@ -2892,8 +2892,14 @@
*/
pm->pm_state = PMC_STATE_DELETED;
- /* Wait for the PMCs runcount to come to zero. */
- pmc_wait_for_pmc_idle(pm);
+ pmc_save_cpu_binding(&pb); /* quiesce_cpus() unbinds us */
+ do {
+ /* Wait for the PMCs runcount to come to zero. */
+ pmc_wait_for_pmc_idle(pm);
+ /* Let every CPU leave any switch-in/out using pm. */
+ quiesce_all_cpus("pmcrel", PDROP);
+ } while (counter_u64_fetch(pm->pm_runcount) != 0);
+ pmc_restore_cpu_binding(&pb);
/*
* At this point the PMC is off all CPUs and cannot be freshly

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 13, 12:25 AM (2 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41686044
Default Alt Text
D61449.1794529557.diff (702 B)

Event Timeline