Page MenuHomeFreeBSD

vt: Use a taskqueue to clear splash_cpu logos
ClosedPublic

Authored by markj on Jan 18 2022, 10:05 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 28, 5:22 AM
Unknown Object (File)
Wed, Apr 24, 1:39 PM
Unknown Object (File)
Fri, Apr 19, 3:55 AM
Unknown Object (File)
Feb 24 2024, 9:03 PM
Unknown Object (File)
Feb 12 2024, 11:48 AM
Unknown Object (File)
Jan 4 2024, 6:30 AM
Unknown Object (File)
Dec 23 2023, 7:06 AM
Unknown Object (File)
Dec 13 2023, 3:13 PM
Subscribers

Details

Summary

vt_fini_logos() calls vtbuf_grow(), which reallocates the console
window's buffer using malloc(M_WAITOK). Because vt_fini_logos() is
called via a callout, we end up panicking if INVARIANTS is enabled.

Fix the problem simply by clearing the logos using a timed taskqueue.
taskqueue_thread is formally allowed to sleep; of course, if we actually
end up sleeping to satisfy the allocation, then we have bigger problems.

Deferring logo initialization to SI_SUB_TASKQ doesn't have a visible
effect.

PR: 260896

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

emaste added inline comments.
sys/dev/vt/vt_cpulogos.c
266

As an aside I wonder if we have a preference for taskqueue_enqueue_timeout_sbt now (and vt_splash_cpu_duration * SBT_1S)

This revision is now accepted and ready to land.Jan 18 2022, 10:20 PM
sys/dev/vt/vt_cpulogos.c
266

Generally yes, so that regular tasks can be scheduled with appropriate precision. Here it doesn't really matter since the task runs only once.

This revision was automatically updated to reflect the committed changes.