-
Notifications
You must be signed in to change notification settings - Fork 26
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
(RHEL-33815) udev-node: optimize device node symlink creation #307
base: main
Are you sure you want to change the base?
Conversation
-1 was used everywhere, but -EBADF or -EBADFD started being used in various places. Let's make things consistent in the new style. Note that there are two candidates: EBADF 9 Bad file descriptor EBADFD 77 File descriptor in bad state Since we're initializating the fd, we're just assigning a value that means "no fd yet", so it's just a bad file descriptor, and the first errno fits better. If instead we had a valid file descriptor that became invalid because of some operation or state change, the other errno would fit better. In some places, initialization is dropped if unnecessary. Partially backported from commit systemd/systemd@254d131 (cherry picked from commit 254d131) Related: RHEL-33815
These 2 operations are inseparable. (cherry picked from commit c9032f9) Related: RHEL-33815
We likely always want to open the directory via a slink. There's currently only one caller so it doesn't make any difference in practice but I think it's still nicer. No functional change. (cherry picked from commit 72a459a) Related: RHEL-33815
That's usually the errno code we return when a device cannot be found because it's been unplugged. (cherry picked from commit e8a54a4) Related: RHEL-33815
And make the new format the one we expect as it should replace the old one pretty quickly. (cherry picked from commit 6d90488) Related: RHEL-33815
If multiple devices requested the same device node symlink with the same priority, then previously we read O(N^2) of files saved in /run/udev/links. This makes if the requested symlink already exists with equal or higher priority, then the symlink is kept, and skip to read all existing files, except for one related to the current device node, in /run/udev/links. Hence, the total amount of file read becomes O(N). This improves performance of testcase_simultaneous_events_2 added by the previous commit about 30%. Before (32.8 sec): ``` ## 3 iterations start: 11:13:44.690953163 ## 3 iterations end: 11:14:17.493974927 ``` After (23.8 sec): ``` ## 3 iterations start: 11:17:53.869938387 ## 3 iterations end: 11:18:17.624268345 ``` This is based on the idea and analysis by Franck Bui. Replaces #25839. Co-authored-by: Franck Bui <[email protected]> (cherry picked from commit 331aa7a) Resolves: RHEL-33815
Commit validationTracker - RHEL-33815 The following commits meet all requirements
Follow-up detectionFailed🔴 Some follow-up commits for this Pull Request were detected in upstream Follow-ups
Commit mentions
Tracker validationSuccess🟢 Tracker RHEL-33815 has set desired product: Pull Request validationFailed🔴 Failed or pending checks - |
… equivalent Several udev rules depends on the previous behavior, i.e. that udev replaces the devlink with the newer device node when the priority is equivalent. Let's relax the optimization done by 331aa7a. Follow-up for 331aa7a. Note, the offending commit drops O(N) of file reads per uevent, and this commit does not change the computational order. So, hopefully the performance impact of this change is small enough. Fixes #28141. (cherry picked from commit 7ec5ce5) Resolves: RHEL-33815
No description provided.