Linux 6.11 Device Mapper Will Optimize Flushing

Written by Michael Larabel in Linux Storage on 5 June 2024 at 06:32 AM EDT. 6 Comments
LINUX STORAGE
The latest performance optimization work for the Linux kernel's Device Mapper (DM) comes thanks to Red Hat's Mikulas Patocka.

A patch queued within the Device Mapper's Git tree ahead of the Linux 6.11 merge window in mid-July is for optimizing flushing. Mikulas Patocka discovered currently inefficient handling of flushing that could lead to multiple unnecessary and redundant flushes to the underlying storage device. Patocka explained in the patch:
"Device mapper sends flush bios to all the targets and the targets send it to the underlying device. That may be inefficient, for example if a table contains 10 linear targets pointing to the same physical device, then device mapper would send 10 flush bios to that device - despite the fact that only one bio would be sufficient.

This commit optimizes the flush behavior. It introduces a per-target variable flush_bypasses_map - it is set when the target supports flush optimization - currently, the dm-linear and dm-stripe targets support it. When all the targets in a table have flush_bypasses_map, flush_bypasses_map on the table is set. __send_empty_flush tests if the table has flush_bypasses_map - and if it has, no flush bios are sent to the targets via the "map" method and the list dm_table->devices is iterated and the flush bios are sent to each member of the list."

This efficiency optimization is queued up in the DM code ahead of the Linux 6.11 cycle.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week