]> git.proxmox.com Git - mirror_zfs.git/commit
Add a delay to tearing down threads.
authorRich Ercolani <214141+rincebrain@users.noreply.github.com>
Mon, 26 Jun 2023 20:57:12 +0000 (16:57 -0400)
committerGitHub <noreply@github.com>
Mon, 26 Jun 2023 20:57:12 +0000 (13:57 -0700)
commit35a6247c5fe788aa77e0b3c7e8010fedb9e60eb5
tree27718eb305396a28cfc9c48dc94bcae64d69eecb
parent8e8acabdcaeb831c777f71361722f4235b698a8d
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
include/os/linux/spl/sys/taskq.h
man/man4/spl.4
module/os/linux/spl/spl-taskq.c