Page MenuHomeFreeBSD

vt: Use a taskqueue to clear splash_cpu logos
ClosedPublic

Authored by markj on Jan 18 2022, 10:05 PM.

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
rS FreeBSD src repository - subversion
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 43975
Build 40863: arc lint + arc unit

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.