hwpmc: don't enter epoch section across mmap hook
This commit is contained in:
parent
6c3c319414
commit
b99aa0fbb2
@ -1717,7 +1717,7 @@ pmc_process_mmap(struct thread *td, struct pmckern_map_in *pkm)
|
||||
const struct pmc_process *pp;
|
||||
|
||||
freepath = fullpath = NULL;
|
||||
epoch_exit_preempt(global_epoch_preempt);
|
||||
MPASS(!in_epoch());
|
||||
pmc_getfilename((struct vnode *) pkm->pm_file, &fullpath, &freepath);
|
||||
|
||||
pid = td->td_proc->p_pid;
|
||||
@ -1743,6 +1743,7 @@ pmc_process_mmap(struct thread *td, struct pmckern_map_in *pkm)
|
||||
done:
|
||||
if (freepath)
|
||||
free(freepath, M_TEMP);
|
||||
epoch_exit_preempt(global_epoch_preempt);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2494,7 +2494,7 @@ vn_mmap(struct file *fp, vm_map_t map, vm_offset_t *addr, vm_size_t size,
|
||||
if ((prot & VM_PROT_EXECUTE) != 0 && error == 0) {
|
||||
pkm.pm_file = vp;
|
||||
pkm.pm_address = (uintptr_t) *addr;
|
||||
PMC_CALL_HOOK(td, PMC_FN_MMAP, (void *) &pkm);
|
||||
PMC_CALL_HOOK_UNLOCKED(td, PMC_FN_MMAP, (void *) &pkm);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -217,7 +217,8 @@ do { \
|
||||
*/
|
||||
#define PMC_CALL_HOOK_UNLOCKED(t, cmd, arg) \
|
||||
do { \
|
||||
if (pmc_hook != NULL) \
|
||||
MPASS(!in_epoch()); \
|
||||
if (pmc_hook != NULL) \
|
||||
(pmc_hook)((t), (cmd), (arg)); \
|
||||
} while (0)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user