From nobody Fri Oct 27 21:24:27 2023 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 4SHFzb6hkdz4xxY8; Fri, 27 Oct 2023 21:24:27 +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 4SHFzb3vJ1z4PJp; Fri, 27 Oct 2023 21:24:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698441867; 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=bPKydzoZ5z/eOJ8BlOhq7DD2qxk4J/cNNDtlUABReEU=; b=lu87+o4ey30J4MznxIvdJqoKRsxj5Z22Bbs1cVOsmlT/BoUWEo2rQefG/toL4wpnlGKKpc qJbAdWzCkGkSoS90MDOlmPdr6ckGZVvevdc3iNXEyDWl0+bHcWpFPGpCmbva7eklI5Euo7 KepW8nbkF9mZ+AKuP9a1qS6neREjdI710WLLzzyA3SbHFGNtgF+dKR1bflSflFZqbf8TVP sJZf1N0utM+dvOnNNayIsvx1/LjIbx+eda4hOFmf2fWVacZIWVfZBG4853NGyJp0vWDipR DZBPBQULbzojgUu8xXtv74PYgdQ+m3S8Vyq+d3vr2Y3Ejn1o9LbEyKaYZhLlrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698441867; 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=bPKydzoZ5z/eOJ8BlOhq7DD2qxk4J/cNNDtlUABReEU=; b=KiTuEdbT5Sxl7T0Lwl54dokDH/qkMDNivt262t4bscZpTMDJPg28aV6RWdnapYLLCUkdpH epHnXXiN3BnCGM9vS9+6+iZ9tDk8wLV99rR0owKRlSAf3i6cie5Y+qBRiHepiS1bRxXKtt 2XjWZUAsFZOBF/VLvDZKMSkzky2gBjr3Js+uUGgheH4jm3FbyoWDSpF5s2nrbWKdE95guB aDSbk7lCBmFfLGZt4OMuX/9hu4VYSkUYbbijC+/Hmmvj4hy5hI5ejGd53qrnS8V9YlPSlz G7qhIrGhTqz6eEN8oA4/rBpkbd0iPbpcOErpsI9rVW5AiQn/B3uI2NwadeoG4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1698441867; a=rsa-sha256; cv=none; b=nYe5RMoJK4TG4KHYw8RzICyPCkpu/nDsrX9+/2JlvkZdEJy6yQk1SwBCHyeBMg9Jkb9+XN k2uq/06zIDc5RK9IZHvK+76LIxkX5D+znVX4iZ19m58QBsc1XXQX5E6b8bjyPzHlk888pI BfOq2LERF56HSuTl3VwlpVVQmHUUhqcSVHQK/snMz72dfjKOGOrtJ8WZgHblK6lYQy3Vnx WDZIYuQBEzChXZ2o5YQ31+nisg8IrqtNOKZXohsYbEL6DAiDj04t2dLIDS3hKMnoVs7m1B R63umxoAUv3OvINY5Ws4O8ig3e7TXFAsEiSsKYZodtJrpImdBGwqaArpeUIKtA== 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 4SHFzb2kQ2zVYv; Fri, 27 Oct 2023 21:24:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 39RLORRg077675; Fri, 27 Oct 2023 21:24:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39RLORn6077672; Fri, 27 Oct 2023 21:24:27 GMT (envelope-from git) Date: Fri, 27 Oct 2023 21:24:27 GMT Message-Id: <202310272124.39RLORn6077672@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: aa7c028adbb4 - main - devd: Improve devmatch support 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aa7c028adbb48bfb5404c567d66cab313d471cfc Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=aa7c028adbb48bfb5404c567d66cab313d471cfc commit aa7c028adbb48bfb5404c567d66cab313d471cfc Author: Warner Losh AuthorDate: 2023-10-27 21:23:47 +0000 Commit: Warner Losh CommitDate: 2023-10-27 21:24:19 +0000 devd: Improve devmatch support We know that calling devmatch will be futile if there's no plug and play information for it to match on. Avoid this generically when we see "? at +on" which happens only when the location and pnpinfo aren't provided. Don't call "service devmatch quietstart" here. We also ignore ACPI devices with a _HID of none. These also will never load a new driver, so avoid calling "service devmatch quietstart" here too. Use the more compatct "$*" instead of "'?'$_" when calling "service devmatch quietstart" since it will evaluate to the same thing. On my laptop, this eliminates 45% of the calls to devmatch. While it would be even better to integrate devmatch into devd (so we only parse linker.hints once), that will have to wait for another day as it's a bit more complex to arrange that avoiding easy to avoid calls. Sponsored by: Netflix Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D42326 --- sbin/devd/devmatch.conf | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/sbin/devd/devmatch.conf b/sbin/devd/devmatch.conf index 085338eabca4..a7c27857c0bd 100644 --- a/sbin/devd/devmatch.conf +++ b/sbin/devd/devmatch.conf @@ -1,14 +1,32 @@ +# Implement the run-time component of devmatch by reacting to nomatch events. + # +# Ignore those devices that can't possibly match. When there's neither a +# location, nor a pnpinfo string, we know that there's nothing devmatch can +# match on. When it's only a location, it'd debateable, but for nomatch +# events, we can't disambiguate between the two reliably. # +nomatch 101 { + match "_" " +at +on .*"; +}; # -# Example devd configuration file for automatically -# loading what modules we can based on nomatch -# events. +# Ignore ACPI devices whose _HID is none. These cannot tell us what to load, +# since 'none' is not a valid id. There's no need to call devvmatch for these either. +# +nomatch 101 { + match "_HID" "none"; + match "bus" "acpi[0-9]+"; +}; + # # Generic NOMATCH event +# +# Note: It would be better to have some internal-to-devd action that will do +# what devmatch does without re-parsing loader.hints for each invocation +# nomatch 100 { - action "service devmatch quietstart '?'$_"; + action "service devmatch quietstart $*"; }; # Add the following to devd.conf to prevent this from running: