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
Unknown Object (File)
Wed, Oct 15, 1:05 AM
Unknown Object (File)
Thu, Oct 9, 12:18 PM
Unknown Object (File)
Mon, Oct 6, 4:49 AM
Unknown Object (File)
Sun, Oct 5, 4:02 AM
Unknown Object (File)
Sun, Sep 28, 8:15 AM
Unknown Object (File)
Fri, Sep 26, 7:40 PM
Unknown Object (File)
Sep 19 2025, 11:11 AM
Unknown Object (File)
Sep 18 2025, 8:54 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.