diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-09-25 13:18:24 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-09-27 10:01:46 +0900 |
commit | 5bbcfbaa11a92732f9bbc8d5f77e9311e6ac3d56 (patch) | |
tree | ea358528dde7bc3f06183f99bc7bf8944c3cdb70 /src/udev/meson.build | |
parent | bb1bc2fcb06ce7a31497e1b24fb5912b40acd751 (diff) | |
download | systemd-5bbcfbaa11a92732f9bbc8d5f77e9311e6ac3d56.tar.gz |
udev: drop workaround for slow read of phys_port_name sysattr
TL;DR
This effectively reverts 8327fd1b11c5fb6529d46dfb40e2af981ffa8545,
eaba9bb3e69635d2c490c5e1b0d262b763753e1d, and its follow-ups, as the
original issue was already fixed by the kernel side.
The original issue that the above commits tried to 'fix' is that reading
phys_port_name triggers a lock in the kernel, hence processing multiple
interfaces at the same time causes extreme slow down.
To workaround the issue, the above commits made several necessary
information retrieved through netlink instead of sysfs attributes.
A patch set for the kernel was proposed as a fix for the issue:
https://lore.kernel.org/all/20210928125500.167943-1-atenart@kernel.org/
and some of them were merged to v5.16:
https://github.com/torvalds/linux/commit/146e5e733310379f51924111068f08a3af0db830,
It has been already backported to 5.4.160, 5.10.80, 5.14.19, and 5.15.3.
When these commits were proposed, it is already claimed that such issue
should be fixed by the kernel side, and udevd should not workaround it.
Neverthless the feature was introduced, as these have theoretical
performance improvement, even if phys_port_name sysattr does not have the
above issue, as in that way udevd can obtain multiple information about
the interface with a single netlink socket operation. See the discussion
in #20744.
However, in reality, only `iflink`, `type`, `address`, and `phys_port_name`
attributes from netlink are used in the udev net_id builtin command. Hence,
after the original issue being fixed in the kernel side, there should be
almost no performance improvement for udevd.
Furthermore, combining attributes from netlink and sysfs makes hard to
test net_id builtin. See #21725.
Let's drop mostly meaningless code, and make net_id builtin easily testable.
Closes #21725.
Diffstat (limited to 'src/udev/meson.build')
-rw-r--r-- | src/udev/meson.build | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/src/udev/meson.build b/src/udev/meson.build index c6711beb5a..08a1d97e81 100644 --- a/src/udev/meson.build +++ b/src/udev/meson.build @@ -39,8 +39,6 @@ libudevd_core_sources = files( 'udev-builtin-net_setup_link.c', 'udev-builtin-path_id.c', 'udev-builtin-usb_id.c', - 'udev-netlink.c', - 'udev-netlink.h', 'net/link-config.c', 'net/link-config.h', ) @@ -214,10 +212,6 @@ tests += [ [threads, libacl]], - [files('test-udev-netlink.c', - 'udev-netlink.c', - 'udev-netlink.h')], - [files('fido_id/test-fido-id-desc.c', 'fido_id/fido_id_desc.c')], ] |