Page MenuHomeFreeBSD

LinuxKPI: avoid userret: Returning with with pinned thread
AcceptedPublic

Authored by bz on Wed, Jun 9, 7:13 PM.

Details

Reviewers
hselasky
Group Reviewers
linuxkpi
Summary

Some code manually calls local_bh_disable() and spin_lock() but
then calls spin_unlock_bh() (or vice versa).
Our code then calls local_bh_disable() again from spin_lock()
which means we have the thread pin count increased twice and that
means we get out of synch and are still pinned when returning to
user space.

Avoid this by adding the explicit local_bh_{enable,disable}() to
the spin_[un]lock_bh() versions.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 39824
Build 36713: arc lint + arc unit

Event Timeline

bz requested review of this revision.Wed, Jun 9, 7:13 PM
bz removed a subscriber: linuxkpi.

I am assuming the reason the sched_[un]pin() are in the spin_[un]lock() and not just in the _bh versions has its reason in Linux and not just in simplification as otherwise we could avoid the "double-pinning"?

I'd really love to get this one sorted quickly as well.

This revision is now accepted and ready to land.Fri, Jun 11, 9:56 AM