Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(drm): group dracut_instmods calls #332

Merged

Conversation

aafeijoo-suse
Copy link
Collaborator

This module loops over many bus devices, and calls dracut_instmods for each
one. E.g., on a Lenovo Thinkpad laptop:

> for i in /sys/bus/{pci/devices,platform/devices,virtio/devices,soc/devices/soc?,vmbus/devices}/*/modalias; do [[ -e $i ]] && [[ -n $(< "$i") ]]  && echo $i; done | wc -l
79

Every call to dracut_instmods spawns a dracut-install process, which in the
previous example means calling dracut-install 79 times using the same
arguments.

If any call to dracut-install fails, dracut continues its execution (even the
errors are not shown, because it's called with --silent). Therefore, let's
take the contents of all the modalias files into an array and call
dracut-install only once, adding also the -o argument, so if any of the
modules cannot be installed, dracut-install does not stop.

Upstream PR dracutdevs#2577 (already merged in the new upstream dracut-ng/dracut-ng@80f2caf)

This module loops over many bus devices, and calls `dracut_instmods` for each
one. E.g., on a Lenovo Thinkpad laptop:

```
> for i in /sys/bus/{pci/devices,platform/devices,virtio/devices,soc/devices/soc?,vmbus/devices}/*/modalias; do [[ -e $i ]] && [[ -n $(< "$i") ]]  && echo $i; done | wc -l
79
```

Every call to `dracut_instmods` spawns a `dracut-install` process, which in the
previous example means calling `dracut-install` 79 times using the same
arguments.

If any call to `dracut-install` fails, dracut continues its execution (even the
errors are not shown, because it's called with `--silent`). Therefore, let's
take the contents of all the `modalias` files into an array and call
`dracut-install` only once, adding also the `-o` argument, so if any of the
modules cannot be installed, `dracut-install` does not stop.
@aafeijoo-suse aafeijoo-suse requested a review from tblume as a code owner May 27, 2024 07:01
@aafeijoo-suse aafeijoo-suse merged commit fe80dac into openSUSE:SUSE/059 May 27, 2024
2 checks passed
@aafeijoo-suse
Copy link
Collaborator Author

FTR: https://bugzilla.redhat.com/show_bug.cgi?id=2278534#c12

On the system in question, a 128 core epyc host with a lot of storage on it:

# for i in /sys/bus/{pci/devices,platform/devices,virtio/devices,soc/devices/soc?,vmbus/devices}/*/modalias; do [[ -e $i ]] && [[ -n $(< "$i") ]]  && echo $i; done | wc -l
14540

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant