Page MenuHomeFreeBSD

allow selwakeup to be called from interrupt filter context.
AcceptedPublic

Authored by adrian on Nov 28 2016, 9:01 PM.
Tags
Referenced Files
F135156123: D8668.diff
Fri, Nov 7, 12:13 AM
Unknown Object (File)
Wed, Nov 5, 1:59 PM
Unknown Object (File)
Thu, Oct 30, 2:07 AM
Unknown Object (File)
Wed, Oct 29, 4:34 AM
Unknown Object (File)
Wed, Oct 29, 4:34 AM
Unknown Object (File)
Tue, Oct 28, 10:22 PM
Unknown Object (File)
Mon, Oct 27, 11:19 PM
Unknown Object (File)
Sun, Oct 19, 3:08 PM
Subscribers

Details

Reviewers
cem
jhb
bapt
Group Reviewers
x11
Summary

The Linux DRM 4.7 work done by Kip minimises changes to the linux code
and one of those changes is that linux interrupts are interrupts, not
deferred.

So driver code that wants to do things like call selwakeup for waking
up sockets (ie, what DRM is doing) is doing it from the interrupt
context, and not deferred into an ithread or tasklet.

This change allows drivers to do it from interrupt filter context.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 6087
Build 6349: arc lint + arc unit

Event Timeline

adrian retitled this revision from to allow selwakeup to be called from interrupt filter context..
adrian updated this object.
adrian edited the test plan for this revision. (Show Details)
cem added a reviewer: cem.
This revision is now accepted and ready to land.Nov 28 2016, 9:04 PM

Running arbitrary code from filters is going to break much more than just selwakeup(). FreeBSD's kernel isn't really designed for that model.

Also, have you run this with WITNESS_SKIPSPIN disabled? The lock ordering of spin locks is rather finicky, especially with regards to _sleep() and cv_wait(). msleep_spin() goes to special hoops separate from _sleep() to handle spin locks. cv_wait* do not and assume a non-spin lock. If you are ktracing a thread that sleeps on st_wait this probably panics in a kernel with INVARIANTS and/or WITNESS.

Looks like jhb's reaciton is controller, but tagging for srcmgr to review.