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)
Sat, Sep 26, 2:01 AM
Unknown Object (File)
Sun, Sep 20, 1:39 PM
Unknown Object (File)
Fri, Sep 18, 3:56 PM
Unknown Object (File)
Fri, Sep 18, 3:56 PM
Unknown Object (File)
Fri, Sep 18, 2:47 PM
Unknown Object (File)
Thu, Sep 10, 6:25 PM
Unknown Object (File)
Tue, Sep 8, 4:49 AM
Unknown Object (File)
Mon, Sep 7, 10:19 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