]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Reduce bufdaemon/bufspacedaemon shutdown time.
authorAlexander Motin <mav@FreeBSD.org>
Wed, 19 Jan 2022 00:26:16 +0000 (19:26 -0500)
committerAlexander Motin <mav@FreeBSD.org>
Wed, 2 Feb 2022 00:53:10 +0000 (19:53 -0500)
commitc27237d62f05f3a1842818c5f3cf87fb861a8402
tree76a656220c27003e959492b7035d7cafdd2de2ab
parentb39b6629170922ba484f3b84b1d2214c18de8b2b
Reduce bufdaemon/bufspacedaemon shutdown time.

Before this change bufdaemon and bufspacedaemon threads used
kthread_shutdown() to stop activity on system shutdown.  The problem is
that kthread_shutdown() has no idea about the wait channel and lock used
by specific thread to wake them up reliably.  As result, up to 9 threads
could consume up to 9 seconds to shutdown for no good reason.

This change introduces specific shutdown functions, knowing how to
properly wake up specific threads, reducing wait for those threads on
shutdown/reboot from average 4 seconds to effectively zero.

MFC after: 2 weeks
Reviewed by: kib, markj
Differential Revision:  https://reviews.freebsd.org/D33936

(cherry picked from commit b7ff445ffa38282daeab36ce82681ba3f54c8851)
sys/kern/vfs_bio.c