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)
committerMike Snitzer <snitzer@redhat.com>
Fri, 4 Jun 2021 16:07:26 +0000 (12:07 -0400)
commitee50cc19d80e9b9a8283d1fb517a778faf2f6899
tree5351719782793f9b8a5f6d27646d36d3ec49c96a
parent6bcd658f2a2a13fb63c38fc018e1ab210396aefc
dm writecache: don't split bios when overwriting contiguous cache content

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>
drivers/md/dm-writecache.c