Page MenuHomeFreeBSD

vt: drop the lock before calling vd_postswitch
AcceptedPublic

Authored by kevans on Jan 10 2025, 4:34 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jun 27, 2:05 AM
Unknown Object (File)
Sat, Jun 27, 2:02 AM
Unknown Object (File)
Thu, Jun 25, 7:33 AM
Unknown Object (File)
Thu, Jun 25, 7:26 AM
Unknown Object (File)
Mon, Jun 15, 7:16 PM
Unknown Object (File)
Mon, Jun 15, 5:38 PM
Unknown Object (File)
May 30 2026, 10:53 AM
Unknown Object (File)
May 30 2026, 4:49 AM
Subscribers

Details

Reviewers
emaste
manu
jhb
Summary

Some postswitch methods, e.g., from i915kms, don't currently expect to
be called under a lock and may try to sleep. The expectation seems OK,
we usually do drop the lock prior to calling vd_postswitch, so let's
avoid an unnecessary panic and drop the lock earlier..

Diff Detail

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

Event Timeline

jhb added inline comments.
sys/dev/vt/vt_core.c
625

Notably, we drop the VT lock before postswitch here already. Might be worth calling out that you are fixing a special case to follow the same behavior as the more general case. Probably the special cal to vd_postswitch was added later and that later commit just got the locking wrong.

This revision is now accepted and ready to land.Jan 10 2025, 12:15 PM