Page MenuHomeFreeBSD

vmm: don't hold the global PPT lock while resetting a device for assignment
Needs ReviewPublic

Authored by nick_spun.io on Wed, Sep 30, 11:47 PM.
Tags
None
Referenced Files
F174196104: D60188.id188285.diff
Thu, Oct 1, 7:20 AM
F174183777: D60188.id188278.diff
Thu, Oct 1, 5:14 AM
F174182047: D60188.diff
Thu, Oct 1, 5:00 AM
F174165699: D60188.diff
Thu, Oct 1, 2:01 AM
F174164741: D60188.id188279.diff
Thu, Oct 1, 1:49 AM
F174164713: D60188.id188280.diff
Thu, Oct 1, 1:49 AM
F174164682: D60188.id188281.diff
Thu, Oct 1, 1:49 AM
F174164015: D60188.diff
Thu, Oct 1, 1:40 AM
Subscribers

Details

Reviewers
adrian
kbowling
markj
Group Reviewers
bhyve
Summary

ppt_assign_device() holds the global PPT lock across the save/reset/restore. pcie_flr() can wait up to the reset timeout, and every PPT operation on every VM stalls behind it.

Reserve the function with resetting and drop the lock for the reset, as ppt_reset_device() already does (D58864). Set ppt->vm first so a competing assign or ppt_detach() gets EBUSY at once instead of sleeping out the reset. Clear it if the assign fails.

ppt_unassign_device() still resets under the lock.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 77569
Build 74452: arc lint + arc unit

Event Timeline

nick_spun.io held this revision as a draft.

set ppt->vm with the reservation

drop the redundant detach check

nick_spun.io retitled this revision from drop mtx during reset to vmm: don't hold the global PPT lock while resetting a device for assignment.Thu, Oct 1, 1:46 AM
nick_spun.io edited the summary of this revision. (Show Details)
nick_spun.io edited the summary of this revision. (Show Details)