]> git.ipfire.org Git - thirdparty/systemd.git/commit
udev: refactoring for managing events for locked block devices
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 6 May 2025 16:09:09 +0000 (01:09 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 9 May 2025 17:41:10 +0000 (02:41 +0900)
commitf8b1d4fdfb6d58352faef47f2845310d53b547e9
tree1b50a68338bc0ee5799a12d5773cf8e7c1ffa5f1
parentb112a676d5c9e54ea2644ef727b3938704c828f9
udev: refactoring for managing events for locked block devices

Previously, when an event for block device is queued or an inotify event
for a block device is triggered, all queued events were checked by
event_queue_assume_block_device_unlocked(), and its cost may be huge
on early boot stage.

This makes locked events are managed in separated prioq and hashmap,
to reduce the cost of event_queue_assume_block_device_unlocked(),
which is now renamed to manager_requeue_locked_events_by_device().

This also changes the clockid of timer events for requeueing and
timeout of retry from CLOCK_BOOTTIME to CLOCK_MONOTONIC. Otherwise,
if the system suspend while an event is locked, the event may be
requeued immediately after come back from the suspend and timed out.
src/udev/udev-manager.c
src/udev/udev-manager.h
src/udev/udev-watch.c