Page MenuHomeFreeBSD

devd: Improve devmatch support
ClosedPublic

Authored by imp on Oct 22 2023, 11:57 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jan 27, 5:03 PM
Unknown Object (File)
Sun, Jan 26, 5:59 PM
Unknown Object (File)
Fri, Jan 24, 6:54 PM
Unknown Object (File)
Nov 28 2024, 6:19 PM
Unknown Object (File)
Sep 25 2024, 8:45 PM
Unknown Object (File)
Sep 22 2024, 8:10 PM
Unknown Object (File)
Sep 22 2024, 11:18 AM
Unknown Object (File)
Sep 18 2024, 11:39 AM
Subscribers

Details

Summary

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

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

imp requested review of this revision.Oct 22 2023, 11:57 PM

s/that/than/ in "more complex to arrange that avoiding easy to avoid calls."?

s/that/than/ in "more complex to arrange that avoiding easy to avoid calls."?

Yes

On my Framework laptop (where I was running recent tests and posting on twitter), this shaves off about 0.7 seconds of boot time and 333 processes. But that's under 20% of the time spent in devd so there's still more investigation to be done.

If you want to get this into 14.0 I won't say no, but gjb might deem it insufficiently critical for inclusion this late in the release cycle. I'll definitely poke at this more after the release and see if I can speed things up for 14.1.

emaste added inline comments.
sbin/devd/devmatch.conf
13

maybe remove this one too?

This revision is now accepted and ready to land.Oct 23 2023, 5:15 PM

If you want to get this into 14.0 I won't say no, but gjb might deem it insufficiently critical for inclusion this late in the release cycle. I'll definitely poke at this more after the release and see if I can speed things up for 14.1.

It's fine for this to be an improvement in 15.0 or 14.1.

This revision was automatically updated to reflect the committed changes.