dm writecache: don't split bios when overwriting contiguous cache content
authorMikulas Patocka <mpatocka@redhat.com>
Wed, 26 May 2021 14:29:45 +0000 (10:29 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jul 2021 07:44:45 +0000 (09:44 +0200)
commit939f750215b89d2cc774a85a6810286aec0f5718
tree851d170f99da36a5d1dcb05950b8db99334bff50
parent65e780667cf39f54154c6d95e40fd650bd0a31c5
dm writecache: don't split bios when overwriting contiguous cache content

[ Upstream commit ee50cc19d80e9b9a8283d1fb517a778faf2f6899 ]

If dm-writecache overwrites existing cached data, it splits the
incoming bio into many block-sized bios. The I/O scheduler does merge
these bios into one large request but this needless splitting and
merging causes performance degradation.

Fix this by avoiding bio splitting if the cache target area that is
being overwritten is contiguous.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/md/dm-writecache.c