From nobody Mon Mar 10 17:35:39 2025 X-Original-To: dev-commits-src-main@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 4ZBPDq3p6Rz5r7MN; Mon, 10 Mar 2025 17:35:39 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZBPDq2QxKz3TYn; Mon, 10 Mar 2025 17:35:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741628139; 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=dtP2dvJYXJ66chXUYge3E3/TeZCFsFcSavfwl4j3Tb8=; b=lQ81Ag3pgoTJW/j7QPvNzm+UKYA8cs8DGr91URO7y/flLVVfAcpSURMQxZ7O9fAxV2PRRA 9TanDxWQ5s8R2RgOkjac+XhL0rAgzUjPY5zu2CH5kcIYgiB+5GufviKr/4/Z9uj+UXpNdm KKVmCdqrg6mgMtBnfzXDz7Kou7dmclO7p+C/JiceAHvkdEl52Y7zxkYybjQGq8ysX4li0L pIrkJ7k4YUov4o9irMROaKhteABLYactcE/n1Ma9IbK559wX/8y3aYOi/wsIz+g+OTorez KFVWFC6eLZJY9oUQfxsEerfMAQJuYpk57NzKTGlIFEVJRxYreziDMp/ox4WC3A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741628139; a=rsa-sha256; cv=none; b=yvzoDeOr2+R1JkKUf+UFgRjXUc9eBONHHU++WkoVNJj3CTewZ31lp0V1bvp2h9lnBAnBgY VrKrwjwAILeyU9FfAovlRFE9xMfnrUEcrcBRtZoqj+by9QvRYzMSZI6cOBVKn7ny13fd5C Wn55zXl49JIwpHzBtkSa+1bRAeQN5NIbMpMdDJRLx5/mTvUdB3rWUqF9TSxUwuDvbKV7W6 I9d2aNWhCKiWnesIPHj9Sd0mpvdUiAC3nyaInnaD9ELjRKVQbwey3MkVH8UYK8twJy0UvL ZxgK9yy2Nn+GpR79Ln13UDQDHjbFdRw+Z0X9KH9EtWGpzxXv9BxfFVzhY/LMJA== 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=1741628139; 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=dtP2dvJYXJ66chXUYge3E3/TeZCFsFcSavfwl4j3Tb8=; b=UKu0pQ4ySGEuFD85oGlz+SPLL3l6UVzPXBz3UUeUMNTsWBmzje3D8d68eeox1uuy8CvJzG 32Ty7W0QLAamzhOY7PDgmxz4fd0d0CGHKaC9KhaXXacNx6Jq81P6xa/AN6hwMJSTNe47LP OvWj32JivmEPGUWGH+LsPSo7qHuxvNr2W43mRRRlOQIMo7vCG6S7ujrgJrJQEqP2a10Asj 28AYVt8ceKajne511DRhUwm3QbqnpaNWEfoZk49sfYwQoD0jjTQrpnAYPM0MpjG3YNEA9f nj5mCV0P3Ad1HqoiRMGnmahkU+FG0RngsRx7mWdu/FV4BXyMippkekA3Ph1kwg== 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 4ZBPDq1gXmzpTx; Mon, 10 Mar 2025 17:35:39 +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 52AHZdKX027035; Mon, 10 Mar 2025 17:35:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 52AHZd58027032; Mon, 10 Mar 2025 17:35:39 GMT (envelope-from git) Date: Mon, 10 Mar 2025 17:35:39 GMT Message-Id: <202503101735.52AHZd58027032@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 44d5f5ed1e95 - main - new-bus: Add taskqueue_bus to process hot-plug device events List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 44d5f5ed1e959d8f2c22b6ee69c6a46a45ccdd8e Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=44d5f5ed1e959d8f2c22b6ee69c6a46a45ccdd8e commit 44d5f5ed1e959d8f2c22b6ee69c6a46a45ccdd8e Author: John Baldwin AuthorDate: 2025-03-10 17:32:23 +0000 Commit: John Baldwin CommitDate: 2025-03-10 17:32:23 +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 --- 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 0422352bba51..38a8cab639e4 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_ */