Page MenuHomeFreeBSD

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

Authored by mav on Sep 2 2021, 12:02 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jan 26, 7:56 PM
Unknown Object (File)
Thu, Jan 16, 4:10 AM
Unknown Object (File)
Dec 3 2024, 11:07 AM
Unknown Object (File)
Nov 14 2024, 1:03 PM
Unknown Object (File)
Nov 13 2024, 12:31 AM
Unknown Object (File)
Oct 17 2024, 7:59 AM
Unknown Object (File)
Sep 21 2024, 8:11 AM
Unknown Object (File)
Sep 18 2024, 6:33 AM
Subscribers
None

Details

Summary

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 spin locks are the only locks allowed.

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.

Test Plan

Simple test using taskqueue_enqueue_timeout() on fast task queue, including recursively, successfully passes on debug kernel.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

mav requested review of this revision.Sep 2 2021, 12:02 AM
mav created this revision.

I like this idea and wouldn't object to it.

This revision is now accepted and ready to land.Sep 2 2021, 7:51 AM

Minor tuning to unlock_spin().

This revision now requires review to proceed.Sep 2 2021, 2:01 PM
This revision is now accepted and ready to land.Sep 2 2021, 3:06 PM