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, Feb 16, 11:36 PM
Unknown Object (File)
Fri, Feb 14, 12:59 PM
Unknown Object (File)
Thu, Feb 13, 3:21 AM
Unknown Object (File)
Thu, Jan 30, 4:34 PM
Unknown Object (File)
Thu, Jan 30, 4:32 PM
Unknown Object (File)
Thu, Jan 30, 4:32 PM
Unknown Object (File)
Thu, Jan 30, 3:20 AM
Unknown Object (File)
Sun, Jan 26, 7:56 PM
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