linux/drivers
Benjamin Marzinski 33304b75df dm-delay: don't busy-wait in kthread
When using a kthread to delay the IOs, dm-delay would continuously loop,
checking if IOs were ready to submit. It had a cond_resched() call in
the loop, but might still loop hundreds of millions of times waiting for
an IO that was scheduled to be submitted 10s of ms in the future. With
the change to make dm-delay over zoned devices always use kthreads
regardless of the length of the delay, this wasted work only gets worse.

To solve this and still keep roughly the same precision for very short
delays, dm-delay now calls fsleep() for 1/8th of the smallest non-zero
delay it will place on IOs, or 1 ms, whichever is smaller. The reason
that dm-delay doesn't just use the actual expiration time of the next
delayed IO to calculated the sleep time is that delay_dtr() must wait
for the kthread to finish before deleting the table. If a zoned device
with a long delay queued an IO shortly before being suspended and
removed, the IO would be flushed in delay_presuspend(), but the removing
the device would still have to wait for the remainder of the long delay.
This time is now capped at 1 ms.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Tested-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
2025-05-04 11:35:05 +02:00
..
accel treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
accessibility treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
acpi libnvdimm additions for 6.15 2025-04-02 20:27:18 -07:00
amba
android
ata treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
atm treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
auxdisplay treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
base treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
bcma
block treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
bluetooth treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
bus treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
cache
cdrom
cdx Merge branches 'apple/dart', 'arm/smmu/updates', 'arm/smmu/bindings', 'rockchip', 's390', 'core', 'intel/vt-d' and 'amd/amd-vi' into next 2025-03-20 09:11:09 +01:00
char treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
clk ARM and clkdev updates for 6.15-rc1 2025-04-03 12:21:44 -07:00
clocksource RISC-V Patches for the 6.15 Merge Window, Part 1 2025-04-04 09:49:17 -07:00
comedi treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
connector
counter Char/Misc fixes for 6.15-rc1 2025-04-02 18:03:34 -07:00
cpufreq treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
cpuidle pmdomain core: 2025-03-25 20:40:51 -07:00
crypto treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
cxl cxl for v6.15 2025-04-02 20:04:43 -07:00
dax
dca
devfreq
dio
dma treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
dma-buf treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
dpll Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-03-20 21:38:01 +01:00
edac - Add infrastructure support to EDAC in order to be able to register memory 2025-03-25 14:00:26 -07:00
eisa
extcon
firewire treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
firmware treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
fpga
fsi
fwctl pds_fwctl: add rpc and query support 2025-03-21 20:57:55 -03:00
gnss
gpio Networking changes for 6.15. 2025-03-26 21:48:21 -07:00
gpu A set of final cleanups for the timer subsystem: 2025-04-06 08:35:37 -07:00
greybus treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
hid treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
hsi treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
hte treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
hv - The 6 patch series "Enable strict percpu address space checks" from 2025-04-01 09:29:18 -07:00
hwmon treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
hwspinlock hwspinlock: Remove unused hwspin_lock_get_id() 2025-03-21 17:12:04 -05:00
hwtracing Char/Misc/IIO driver updates for 6.15-rc1 2025-04-01 11:26:08 -07:00
i2c treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
i3c i3c: Add NULL pointer check in i3c_master_queue_ibi() 2025-03-31 11:44:00 +02:00
idle Power management updates for 6.15-rc1 2025-03-25 15:00:18 -07:00
iio treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
infiniband treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
input A set of final cleanups for the timer subsystem: 2025-04-06 08:35:37 -07:00
interconnect
iommu treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
ipack
irqchip irqdomain: Rename irq_get_default_host() to irq_get_default_domain() 2025-04-04 16:39:10 +02:00
isdn treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
leds treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
macintosh treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
mailbox treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
mcb
md dm-delay: don't busy-wait in kthread 2025-05-04 11:35:05 +02:00
media treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
memory treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
memstick treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
message SCSI misc on 20250326 2025-03-26 19:57:34 -07:00
mfd * Maxim MAX77705: 2025-03-29 14:33:13 -07:00
misc treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
mmc treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
most treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
mtd treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
mux
net treewide: Convert new and leftover hrtimer_init() users 2025-04-05 10:30:17 +02:00
nfc treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
ntb Bug fixes for NTB Switchtec driver mw negative shift, Intel NTB link 2025-04-04 14:23:07 -07:00
nubus
nvdimm libnvdimm additions for 6.15 2025-04-02 20:27:18 -07:00
nvme treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
nvmem net, treewide: define and use MAC_ADDR_STR_LEN 2025-03-19 19:17:58 +01:00
of Devicetree for v6.15: 2025-03-29 11:23:16 -07:00
opp
parisc
parport treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
pci treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
pcmcia treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
peci
perf pci-v6.15-changes 2025-03-28 19:36:53 -07:00
phy phy-for-6.15 2025-04-01 12:47:11 -07:00
pinctrl Pin control changes for the v6.15 kernel cycle: 2025-03-29 16:59:16 -07:00
platform treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
pmdomain
pnp Staging driver updates for 6.15-rc1 2025-04-02 18:09:17 -07:00
power i2c-for-6.15-rc1 2025-04-01 14:21:02 -07:00
powercap Power management updates for 6.15-rc1 2025-03-25 15:00:18 -07:00
pps treewide: Convert new and leftover hrtimer_init() users 2025-04-05 10:30:17 +02:00
ps3
ptp treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
pwm Pin control changes for the v6.15 kernel cycle: 2025-03-29 16:59:16 -07:00
rapidio
ras
regulator These are objtool fixes and updates by Josh Poimboeuf, centered 2025-04-02 10:30:10 -07:00
remoteproc remoteproc: qcom_q6v5_pas: Make single-PD handling more robust 2025-03-22 08:42:39 -05:00
reset remoteproc updates for v6.15 2025-03-29 17:18:50 -07:00
rpmsg
rtc treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
s390 treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
sbus
scsi treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
sh
siox
slimbus
soc soc: drivers for 6.15, part 2 2025-04-04 09:06:32 -07:00
soundwire soundwire updates for 6.15 2025-04-01 12:43:13 -07:00
spi spi: Fixes for v6.15 2025-04-04 09:09:34 -07:00
spmi
ssb
staging treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
target treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
tc
tee
thermal More thermal control updates for 6.15-rc1 2025-04-01 16:51:44 -07:00
thunderbolt USB/Thunderbolt update for 6.15-rc1 2025-04-02 18:23:31 -07:00
tty treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
ufs Revert "Merge tag 'irq-msi-2025-03-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip" 2025-03-28 11:22:54 -07:00
uio
usb treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
vdpa
vfio VFIO updates for v6.15-rc1 2025-04-01 19:35:19 -07:00
vhost virtio: features, fixes, cleanups 2025-04-01 18:52:54 -07:00
video treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
virt treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
virtio virtio: features, fixes, cleanups 2025-04-01 18:52:54 -07:00
w1
watchdog treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
xen - The 6 patch series "Enable strict percpu address space checks" from 2025-04-01 09:29:18 -07:00
zorro
Kconfig
Makefile