From nobody Fri Jan 28 15:30:23 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id DAA801980FB0; Fri, 28 Jan 2022 15:30:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JlhH35sDCz4bfQ; Fri, 28 Jan 2022 15:30:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643383823; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=21fmxjCSdnxQjb0XlBbvkQt8e+jhq+N/ePhm09vugsM=; b=khUeB+DAHZLYSvwSAvz2az9ANXFHdgP+l+nlVaqyoAN52Nme4HkHtUqhHwO7GrMBsbjxWu BmBwGyDFrwPcHNr/j65XTzXR9jD4zuk50YD7rlWQgzJJ3ZTBPRPRe2Q565FVSDzxYLrZay HY62xY1zEPnoht807hqESdsdepnUQv/nvKT/wuDLJIyVi7jKouKRSZNSz2kpUUCqFOIxsc RS2FrRIbkRopC/Nq5aEbWzLS4iSuanuSEcec/g1dcCek8CPe+rPHtRffWy549wXYSp6IgP CML0vFlvZPOA+S8wtmRZ22lof4tzZWAzs6vso9bZcJd4BuX3M0G2fVUlpISQeA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A9BA32C6F8; Fri, 28 Jan 2022 15:30:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 20SFUNIr058530; Fri, 28 Jan 2022 15:30:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20SFUNFN058529; Fri, 28 Jan 2022 15:30:23 GMT (envelope-from git) Date: Fri, 28 Jan 2022 15:30:23 GMT Message-Id: <202201281530.20SFUNFN058529@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: d7af180a301b - stable/13 - vt: Use a taskqueue to clear splash_cpu logos List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d7af180a301bd3d16b4f64860d22dacc0d32dc39 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643383823; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=21fmxjCSdnxQjb0XlBbvkQt8e+jhq+N/ePhm09vugsM=; b=S4quzBGYtUgQCcNjOEt61SF5tHr2aD9oQsExxuUz81HUBeS+NXmN5ItE0LNLDS8rqiC/UR TaJxI2JZGR3pxcr5kqj/wrNbriHXunnMjLZQ+Sfb8sARl9Vk6GC+zckkzaVLcOGA2cwVSe dciS4zkBkH7gsbbVzwHvro8p6fPOJWPhMuQ/72U8ifAanXEYLTR6oybLWGxVOwVPPPZQOR DxA1E139x+c2Wgs9QaINq7cRoDKQzBQx9jtigDQb3om5srVEPIIBzLt88XC2iLrd28O7Xa bNn3ttaC3XAy5ew9ezhFbrvFO6PugIcM/mu5+ampI88pluJu/cPvxzWSSmQbLw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643383823; a=rsa-sha256; cv=none; b=kJacWu2Wl0p8uAVDkjYWtoccgEcBZkiJThf8I9b1LX8IIPQVTt/ZOMb0t2x8Mn0mQue9eG KqCooYzBHOCUoA+dQVQRWp85Iuj9TXJ1UhI/zfViDzRIUCivaOvlbz+AmJhO0ie/iHgrEx tsg5i7eIlw9ZTATdQa2VVuyMWtrOiJRvKZIXiDrNeOrGVu27Soso99cqCyFrKr7aNuuKqb EYkcMvHxUo+yP6w0vPQIRq/hgoQKM1Kg4RwFzgLof2EwTubtqHsjX25vuT/EZUtDrwZcdx GjMW4YUzmUKLzCFgjuZShVehyA7i+L+cIQUNAGxsXlQtwqAGMbGxFGZxE/XwNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d7af180a301bd3d16b4f64860d22dacc0d32dc39 commit d7af180a301bd3d16b4f64860d22dacc0d32dc39 Author: Mark Johnston AuthorDate: 2022-01-19 14:48:31 +0000 Commit: Mark Johnston CommitDate: 2022-01-28 15:28:30 +0000 vt: Use a taskqueue to clear splash_cpu logos 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. PR: 260896 Reviewed by: emaste Sponsored by: The FreeBSD Foundation (cherry picked from commit 6c7e4d72b1c964e4147831b45e0b312f6ed97cd2) --- sys/dev/vt/vt_cpulogos.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/dev/vt/vt_cpulogos.c b/sys/dev/vt/vt_cpulogos.c index 720e64585e16..c62b13a9097a 100644 --- a/sys/dev/vt/vt_cpulogos.c +++ b/sys/dev/vt/vt_cpulogos.c @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -43,7 +44,7 @@ extern const unsigned char vt_beastie_vga16[]; extern const unsigned char vt_beastie2_vga16[]; extern const unsigned char vt_orb_vga16[]; -static struct callout vt_splash_cpu_callout; +static struct timeout_task vt_splash_cpu_fini_task; static inline unsigned char vt_vga2bsd(unsigned char vga) @@ -149,7 +150,7 @@ vtterm_draw_cpu_logos(struct vt_device *vd) } static void -vt_fini_logos(void *dummy __unused) +vt_fini_logos(void *dummy __unused, int pending __unused) { struct vt_device *vd; struct vt_window *vw; @@ -260,11 +261,12 @@ vt_init_logos(void *dummy) vt_resume_flush_timer(vw, 0); } - callout_init(&vt_splash_cpu_callout, 1); - callout_reset(&vt_splash_cpu_callout, vt_splash_cpu_duration * hz, + TIMEOUT_TASK_INIT(taskqueue_thread, &vt_splash_cpu_fini_task, 0, vt_fini_logos, NULL); + taskqueue_enqueue_timeout(taskqueue_thread, &vt_splash_cpu_fini_task, + vt_splash_cpu_duration * hz); out: VT_UNLOCK(vd); } -SYSINIT(vt_logos, SI_SUB_CPU + 1, SI_ORDER_ANY, vt_init_logos, NULL); +SYSINIT(vt_logos, SI_SUB_TASKQ, SI_ORDER_ANY, vt_init_logos, NULL);