Commit 6806bc0f authored by Mikulas Patocka's avatar Mikulas Patocka Committed by Carlos Llamas
Browse files

BACKPORT: FROMGIT: dm: optimize flushes



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.

Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
Reviewed-by: default avatarMike Snitzer <snitzer@kernel.org>
Suggested-by: default avatarYang Yang <yang.yang@vivo.com>

Bug: 337169537
(cherry picked from commit 69d7125a61aeb5e55cafeebe7ae7582068589dbe https://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git

 dm-6.11)
(resolved trivial merge conflict in drivers/md/dm.c)
Change-Id: I003426540701f51ef2f3d34df1880868f295b3ff
Signed-off-by: default avatarYang Yang <yang.yang@vivo.com>
parent 3a1e448e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment