Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v1: This is quite a primitive attempt to keep write-back data under control. We simply use the current loadavg to estimate a value of outstanding write requests. If we get above 1 loadavg per active core (by dividing loadavg by worker threads), we throttle execution for a few milliseconds to give the disk time to write data back. The value of 20ms per request was found experimentally (it matches around one revolution of a standard HDD + some overhead). In my test setup it works quite well: It keeps the CPU mostly as busy as before but the loadavg peaks at around 9.5 for an 8-core system instead of going to 15+. We cannot expect fossilize to progress any further if the disks cannot keep up with the write-back amount from the GPU driver, anyways, so there's no advantage in not waiting for small periods of time. A better solution could measure the IO PSI data of the process trying to keep the IO latency below a certain threshold. But the problem with loadavg in Linux is that it measures everything in a system that waits busily for events, be it IO, memory allocation, other tasks, etc... But we are mainly interested in keep IO under control, everything else can be covered by the CPU scheduler. Signed-off-by: Kai Krakow <kai@kaishome.de>
- Loading branch information