Jens Axboe, creator of io_uring and I/O schedulers CFQ, Deadline, and Noop, has continued his experiments with optimizing I/O in the Linux kernel. This time, he focused on the I/O schedulers BFQ and mq-deadline, which turned out to be a bottleneck at least in the case of high-speed NVMe drives.
As the study of the situation revealed, one of the key reasons for the suboptimal performance of the I/O scheduler subsystems was issues with lock contention, where attempts are made to acquire locks held by other threads. Thanks to measures aimed at reducing contention during lock handling, such as dispatch serialization and request insertion, the throughput of the schedulers increased several times in certain scenarios (in IOPS).
When testing the BFQ scheduler with the fio utility, performance increased from 567K to 1551K input/output operations per second, while lock contention decreased from 96% to 30%. In the case of mq-deadline, performance after applying the proposed patches using an NVMe drive rose from 1070K to 2560K input/output operations per second (IOPS), and lock contention fell from 94% to 23%.
Sursa: opennet.ro
