From nobody Tue Apr 29 18:30:36 2025 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 4Zn8596L8xz5vMsr; Tue, 29 Apr 2025 18:30:37 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Zn8585DSSz4HV6; Tue, 29 Apr 2025 18:30:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1745951436; 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=7dh6FEBOaBEPd2RbY24cuxXSqNNUsKL/IJOQyngqrxk=; b=juE1ZbGDnxmDsmqSuIB/6H+lo45EiRxBmNJTf+lXODob2pKXlism51KgzAtdb+0vTcTnn0 wUrGPCPLGT344Jo9qU2GzqR5niPrajOG45MI0L7E3m79Mt+C9qNpQRXbxoDvdwOQ4ewyIH YMRO3rxeFqfYBp6XMZcwLEJlEjD+uU9mmBzcklPeLYppHWxiie4fqqzIXfee7/sQQTqe3R DVKNaVoyKbN9JXL5iEzOXoopzqeYFF/U9GgicoZ8wnUrNDWYG/4W7RvKN7A/HBvo9kNaRT hzXjtqOoselXlUpyZ/qX+CMKUSRvjbDp6o/2pmgxNAz4/2rGL5K/26l7eU+8yQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1745951436; a=rsa-sha256; cv=none; b=YLAmr5OtZl5orklFNRfR9oQIL3Q5WbAWB82rBAXUhQsPLuji87V7MDUkbdKKBawt0ql0qK w76dpliFAu5GfE1Zy52AXP7a3qDODnjwxwh+IsGOaEH1xzhkLqRRHwKaeaxj0vYELBaow9 UzIynItPY8D2JD5I2kFY/ucqW3DbDRsz1tQ3GVp3uTjvQvxcYFGUILQhPnHzoGI+0Zkfck 18EZBZhimjgZrrx5QH5YbXu9PKbhZOHzAyh8WWOtFjLrWRIiylCIq0zFRLCHYWoHa3GO7z /RP+jMNDaDCUsXKCEIQPPPUovhuLFs930zykSIASwBMX0WqKPM71H+n6qhv2UA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1745951436; 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=7dh6FEBOaBEPd2RbY24cuxXSqNNUsKL/IJOQyngqrxk=; b=YM1YzHAld1rGD8OUTMpawKKbpvz1NxD7y0zhSuMtVrGapye1TQJq2GOaX1P+bQvKr3tFA8 xsSChBISi8HU30QlAuYDmPQgxsqAaAWvb1ivp9YD3paGloP2LeLwbdAbAp61vNV7SxTyim Pny3Z2oWq8kxJHb6MQkVZlQFGeJvrfIVltuLkhYNPRYLIVnkqIq5MH3+ycQwEWmeH7CknW zF9zCylL/0cog1IlbeT9jf9h+AfDAQWf0gt0fXNA0m0wuB/fsnOqVKJhUDExMijaAM5ok9 VaLgdjgDENVIsJGWINezBvfNumVA+iSewjLWwYj9DDXzoLAzm4oNT7sWow0p0A== 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 4Zn8584r5RzXb3; Tue, 29 Apr 2025 18:30:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 53TIUaNp022521; Tue, 29 Apr 2025 18:30:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 53TIUarT022518; Tue, 29 Apr 2025 18:30:36 GMT (envelope-from git) Date: Tue, 29 Apr 2025 18:30:36 GMT Message-Id: <202504291830.53TIUarT022518@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 3a54ca5e28d8 - stable/14 - new-bus: Add taskqueue_bus to process hot-plug device events 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3a54ca5e28d847ab46168d3ea866259e806338fe Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=3a54ca5e28d847ab46168d3ea866259e806338fe commit 3a54ca5e28d847ab46168d3ea866259e806338fe Author: John Baldwin AuthorDate: 2025-03-10 17:32:23 +0000 Commit: John Baldwin CommitDate: 2025-04-29 14:34:05 +0000 new-bus: Add taskqueue_bus to process hot-plug device events Use a system-wide taskqueue for hot-plug events. This avoids possibly blocking unrelated events on the thread taskqueue without requiring multiple driver-specific taskqueues. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D49268 (cherry picked from commit 44d5f5ed1e959d8f2c22b6ee69c6a46a45ccdd8e) --- sys/kern/subr_bus.c | 3 +++ sys/sys/taskqueue.h | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index b71a46edc544..211fe45b1374 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -51,6 +51,7 @@ #include #include #include +#include #include #include #ifdef INTRNG @@ -120,6 +121,8 @@ struct device_prop_elm { LIST_ENTRY(device_prop_elm) link; }; +TASKQUEUE_DEFINE_THREAD(bus); + static void device_destroy_props(device_t dev); /** diff --git a/sys/sys/taskqueue.h b/sys/sys/taskqueue.h index 9757e1fce575..9da364a1a716 100644 --- a/sys/sys/taskqueue.h +++ b/sys/sys/taskqueue.h @@ -215,4 +215,10 @@ struct taskqueue *taskqueue_create_fast(const char *name, int mflags, taskqueue_enqueue_fn enqueue, void *context); +/* + * This queue is used to process asynchronous device events such as + * hot plug insertion and removal of devices. + */ +TASKQUEUE_DECLARE(bus); + #endif /* !_SYS_TASKQUEUE_H_ */