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
F102488449: D31778.id94595.diff
Wed, Nov 13, 12:31 AM
Unknown Object (File)
Thu, Oct 17, 7:59 AM
Unknown Object (File)
Sep 21 2024, 8:11 AM
Unknown Object (File)
Sep 18 2024, 6:33 AM
Unknown Object (File)
Sep 18 2024, 12:15 AM
Unknown Object (File)
Sep 8 2024, 10:04 AM
Unknown Object (File)
Sep 2 2024, 4:32 AM
Unknown Object (File)
Aug 31 2024, 5:50 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