HomeFreeBSD

Do not run pmclog_configure_log() without pmc_sx protection.

Description

Do not run pmclog_configure_log() without pmc_sx protection.

The r195005 unlocked pmc_sx before calling into pmclog_configure_log()
to avoid the LOR, but it allows flush or closelog to run in parallel
with the configuration, causing many failure modes.

Revert r195005. Pre-create the logging process, allowing it to run
after the set up succeeded, otherwise the process terminates itself.

Reported and tested by: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D12882

Details

Provenance
kibAuthored on
Reviewer
markj
Differential Revision
D12882: Several hwpmc(4) fixes mostly for logging.
Parents
rS325276: Be protective and check the po_file validity before dropping the ref.
Branches
Unknown
Tags
Unknown