]> www.infradead.org Git - users/hch/xfstests-dev.git/commit
fstests: use udevadm wait in preference to settle
authorDave Chinner <dchinner@redhat.com>
Tue, 26 Nov 2024 20:58:10 +0000 (07:58 +1100)
committerZorro Lang <zlang@kernel.org>
Sun, 8 Dec 2024 14:08:31 +0000 (22:08 +0800)
commit5f7a66b6dc4ce839e21ddf40dba1759bb1095f98
treef530dcfa2524d3a6fea81375291e657d9e86828f
parent91bc186b2479386864b29b5324bc1f4234f38233
fstests: use udevadm wait in preference to settle

When running lots of tests in parallel, there are lots of
filesystems and block devices changing state. This generates a lot
of udev events when means the udev event queue is rarely empty.
Unfortunately, an empty event queue is what udev settling waits
upon. Hence calling UDEV_SETTLE_PROG can mean waiting for a lot of
time for other tests to stop generating udev events.

For the majority of cases, what we care about is that udev has
performed device node addition or removal, not that there are no
udev events pending. Recent(-ish) systemd releases support 'udevadm
wait' to wait for a specific file to be created or unlinked rather
than waiting for the event that does that work to be completed.

Hence we don't have to wait for the udev event queue to empty,
just for the udev event that does the device node manipulation to
complete.

Introduce detection of 'udevadm wait' support and a _udev_wait()
wrapper function to use it if it is available. If it isn't, the use
the existing UDEV_SETTLE_PROG behaviour.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Zorro lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/config
common/rc
tests/btrfs/291
tests/generic/081
tests/generic/108
tests/generic/459