From nobody Wed Jan 19 15:55:23 2022 X-Original-To: dev-commits-src-all@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 7C7871957CAB; Wed, 19 Jan 2022 15:55: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 4Jf9G334bCz4kMp; Wed, 19 Jan 2022 15:55:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642607723; 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=2RcKg3fQ6FjlCXGOnCSYCvSr0hk//Cb4Qh96/ij0o2g=; b=gIzBxySIN3wHB/3ejJu0zS9BlvTwLC+Kz39bfcOPpBtOiGhZjTdpxzsJ2jgCJaDjtNdIfm US+cbpLuAicR5Z/cwEG1fXUG/ienE8e9hjxVrLC8g5mqSc4gjVezD/fiIm2pvRnpI/kkwE htCVRhuejcptkf4fD6T5Efc5+qnwN1KpS8A4yb8LvIeetnaxFLo0RG/R4u3lkOtC417sC8 6HHTXAAnSHfafW6WxsC6z2NhKKwtZdUjH9TK5nbSSX9y+wYsw665ul00/aNBKtsEQwI364 isD30oT7GgCsCAvJx2Xem4DaFKNiOB0UzyQ/Spc6wDgdjxqjd8lbXzv2fljOKA== 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 4489917947; Wed, 19 Jan 2022 15:55: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 20JFtNs0029996; Wed, 19 Jan 2022 15:55:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20JFtNNa029995; Wed, 19 Jan 2022 15:55:23 GMT (envelope-from git) Date: Wed, 19 Jan 2022 15:55:23 GMT Message-Id: <202201191555.20JFtNNa029995@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 6c7e4d72b1c9 - main - vt: Use a taskqueue to clear splash_cpu logos List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/main X-Git-Reftype: branch X-Git-Commit: 6c7e4d72b1c964e4147831b45e0b312f6ed97cd2 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642607723; 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=2RcKg3fQ6FjlCXGOnCSYCvSr0hk//Cb4Qh96/ij0o2g=; b=besReMeB45X5zqMH7jm3tRqx6LtrvqoKDwbBSPCbL9KJmWsVtYQbK+7qmIMMcmegf0IZ6w AjlhYi1nhhGEz4p8pKutnW294HAc6pT+0QTSz1l1jpl7wLt6mKEICmcbcq7eMgKe6iGwji qn16PawZtmZE4oU1Mi3qVL6SyOhRYe8KEG3paVp5nGnfB3MwvvlCbPY5mGsGoU3EgogEaY kNGpL6z/qEne7ueDNx4NyADapffd4Bg16ySJq1JT9cxjdhAY4T1eVhJmdIUCCt4ppZHYV3 xICv+ljzVh9G3FBRiIUr/Oj4sHOkh/bbvpn3Yuu2KB5VSYw8zYpghPOcDLO/zw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1642607723; a=rsa-sha256; cv=none; b=Je9G9PECb0gDZcXnbSUDVGwPiIoSTSWDy2WR7Pq2V2zd8F5cP3ujh1Zc92mxCJ+vIB7/H0 LMe5IdEMklK6Jdl4hd+Wh+3rgEg6PM+zBPcRRVfV+YBxoFDJ4X5sXENXFhLOStXQAOrrFk ckrAiBtAgScNJ++HSZL8+yoUZI66WRLGza05ZCMuFcEVty/5lJr9f437YYHz0VrXrTugp/ YRuuyo7YaViUmUx0g+A6OHL0KD9Iz8lJ5+MwO+yp+wD3dAPr9T5q4U4WlLtlUDZAjdisRm puSQS6YYe63arDabAr0i1aNE4Mp9CRofOGV3AA4SO+aq6BnmUPFwbwiAJ7Gh7A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6c7e4d72b1c964e4147831b45e0b312f6ed97cd2 commit 6c7e4d72b1c964e4147831b45e0b312f6ed97cd2 Author: Mark Johnston AuthorDate: 2022-01-19 14:48:31 +0000 Commit: Mark Johnston CommitDate: 2022-01-19 15:53:15 +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 MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D33932 --- 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);