HomeFreeBSD

Add a delay to tearing down threads.

Description

Add a delay to tearing down threads.

It's been observed that in certain workloads (zvol-related being a
big one), ZFS will end up spending a large amount of time spinning
up taskqs only to tear them down again almost immediately, then
spin them up again...

I noticed this when I looked at what my mostly-idle system was doing
and wondered how on earth taskq creation/destroy was a bunch of time...

So I added a configurable delay to avoid it tearing down tasks the
first time it notices them idle, and the total number of threads at
steady state went up, but the amount of time being burned just
tearing down/turning up new ones almost vanished.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
Closes #14938

Details

Provenance
rincebrain_gmail.comAuthored on Jun 26 2023, 8:57 PM
GitHub <noreply@github.com>Committed on Jun 26 2023, 8:57 PM
Parents
rG8e8acabdcaeb: Fix memory leak in zil_parse().
Branches
Unknown
Tags
Unknown