hwpmc: limit wait for user callchain collection to 1 tick
authorMatt Macy <mmacy@FreeBSD.org>
Mon, 5 Nov 2018 08:11:16 +0000 (08:11 +0000)
committerMatt Macy <mmacy@FreeBSD.org>
Mon, 5 Nov 2018 08:11:16 +0000 (08:11 +0000)
commitacf50a7f68f4ef56798058f3b74fe0e9e7d166ef
tree4788b532cf44fc67ff7776c8a84cafe109a50026
parentb465e0bb56278398f6bce2cae6917216e78460b4
hwpmc: limit wait for user callchain collection to 1 tick

The hwpmc pcpu sample buffer is prone to head of line blocking
when waiting for user process to return to user space and
collect a pending callchain. If more than one tick has elapsed
between the time the sample entry was marked for collection and
the time that the hardclock pmc handler runs to copy the records
to a larger temporary buffer, mark the sample entry as not in
use.

This changes reduces the number of samples marked as not valid
when collecting under load from ~99.5% to 5-20%.

Reported by: mjg@
MFC after: 3 days
sys/dev/hwpmc/hwpmc_mod.c