HomeFreeBSD

callout(9): Allow spin locks use with callout_init_mtx().

Description

callout(9): Allow spin locks use with callout_init_mtx().

Implement lock_spin()/unlock_spin() lock class methods, moving the
assertion to _sleep() instead. Change assertions in callout(9) to
allow spin locks for both regular and C_DIRECT_EXEC cases. In case of
C_DIRECT_EXEC callouts spin locks are the only locks allowed actually.

As the first use case allow taskqueue_enqueue_timeout() use on fast
task queues. It actually becomes more efficient due to avoided extra
context switches in callout(9) thanks to C_DIRECT_EXEC.

MFC after: 2 weeks
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D31778

(cherry picked from commit 4730a8972b1f4b67bf9ffde8e63ca906ef4c9563)

Details

Provenance
mavAuthored on Sep 3 2021, 1:16 AM
Reviewer
hselasky
Differential Revision
D31778: callout(9): Allow spin locks use with callout_init_mtx()
Parents
rGc8f2af5f5d1f: geli(8): Do not report error on resize to the same size.
Branches
Unknown
Tags
Unknown