3f2e5b8584
broke in two ways. One, the pacing variable was accessed in multiple threads in an unsafe way. Two, since large numbers of I/O could come down from the buf layer at one time, large numbers of allocation failures could happen all at once, resulting in a huge pace value that would limit I/Os to 10 IOPS for minutes (or even hours) at a time. While a real solution to these problems requires substantial work (to go to a no-allocation after the first model, or to have some way to wait for more memory with some kind of reserve for pager and swapper requests), it is relatively easy to make this simplistic pacing less pathological. Move to using a volatile variable with loads and stores. While this is a little racy, losing the race is safe: either you get memory and proceed, or you don't and queue. Second, sleep for 1ms (or one tick, whichever is larger) instead of 100ms. This removes the artificial 10 IOPS limit while still easing up on new I/Os during memory shortages. Remove tying the amount of time we do this to the number of failed requests and do it only as long as we keep failing requests. Finally, to avoid needless recursion when memory is tight (start -> g_io_deliver() -> g_io_request() -> start -> ... until we use 1/2 the stack), don't do direct dispatch while pacing. This should be a rare event (not steady state) so the performance hit here is worth the extra safety of not starving g_down() with directly dispatched I/O. Differential Review: https://reviews.freebsd.org/D3546 |
||
---|---|---|
.. | ||
bde | ||
cache | ||
concat | ||
eli | ||
gate | ||
journal | ||
label | ||
linux_lvm | ||
mirror | ||
mountver | ||
multipath | ||
nop | ||
part | ||
raid | ||
raid3 | ||
sched | ||
shsec | ||
stripe | ||
uncompress | ||
uzip | ||
vinum | ||
virstor | ||
zero | ||
geom_aes.c | ||
geom_bsd_enc.c | ||
geom_bsd.c | ||
geom_ccd.c | ||
geom_ctl.c | ||
geom_ctl.h | ||
geom_dev.c | ||
geom_disk.c | ||
geom_disk.h | ||
geom_dump.c | ||
geom_event.c | ||
geom_flashmap.c | ||
geom_fox.c | ||
geom_int.h | ||
geom_io.c | ||
geom_kern.c | ||
geom_map.c | ||
geom_mbr_enc.c | ||
geom_mbr.c | ||
geom_pc98_enc.c | ||
geom_pc98.c | ||
geom_redboot.c | ||
geom_slice.c | ||
geom_slice.h | ||
geom_subr.c | ||
geom_sunlabel_enc.c | ||
geom_sunlabel.c | ||
geom_vfs.c | ||
geom_vfs.h | ||
geom_vol_ffs.c | ||
geom.h | ||
notes |