[dm-devel] Patch "dm writecache: count number of blocks read, not number of read bios" has been added to the 5.19-stable tree

Sasha Levin sashal at kernel.org
Sat Aug 13 20:34:10 UTC 2022


This is a note to let you know that I've just added the patch titled

    dm writecache: count number of blocks read, not number of read bios

to the 5.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     dm-writecache-count-number-of-blocks-read-not-number.patch
and it can be found in the queue-5.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable at vger.kernel.org> know about it.



commit e2e587607fbec23ac21075c3fa83afb53dc220d9
Author: Mikulas Patocka <mpatocka at redhat.com>
Date:   Mon Jul 11 16:30:52 2022 -0400

    dm writecache: count number of blocks read, not number of read bios
    
    [ Upstream commit 2c6e755b49d273243431f5f1184654e71221fc78 ]
    
    Change dm-writecache, so that it counts the number of blocks read
    instead of the number of read bios. Bios can be split and requeued
    using the dm_accept_partial_bio function, so counting bios caused
    inaccurate results.
    
    Fixes: e3a35d03407c ("dm writecache: add event counters")
    Reported-by: Yu Kuai <yukuai1 at huaweicloud.com>
    Signed-off-by: Mikulas Patocka <mpatocka at redhat.com>
    Signed-off-by: Mike Snitzer <snitzer at kernel.org>
    Signed-off-by: Sasha Levin <sashal at kernel.org>

diff --git a/Documentation/admin-guide/device-mapper/writecache.rst b/Documentation/admin-guide/device-mapper/writecache.rst
index 10429779a91a..7bead3b52690 100644
--- a/Documentation/admin-guide/device-mapper/writecache.rst
+++ b/Documentation/admin-guide/device-mapper/writecache.rst
@@ -78,8 +78,8 @@ Status:
 2. the number of blocks
 3. the number of free blocks
 4. the number of blocks under writeback
-5. the number of read requests
-6. the number of read requests that hit the cache
+5. the number of read blocks
+6. the number of read blocks that hit the cache
 7. the number of write requests
 8. the number of write requests that hit uncommitted block
 9. the number of write requests that hit committed block
diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c
index e4753e8c46d3..b71efe08d809 100644
--- a/drivers/md/dm-writecache.c
+++ b/drivers/md/dm-writecache.c
@@ -1365,6 +1365,7 @@ static enum wc_map_op writecache_map_read(struct dm_writecache *wc, struct bio *
 		}
 	} else {
 		writecache_map_remap_origin(wc, bio, e);
+		wc->stats.reads += (bio->bi_iter.bi_size - wc->block_size) >> wc->block_size_bits;
 		map_op = WC_MAP_REMAP_ORIGIN;
 	}
 



More information about the dm-devel mailing list