[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LRH.2.02.2207111630310.5249@file01.intranet.prod.int.rdu2.redhat.com>
Date: Mon, 11 Jul 2022 16:30:52 -0400 (EDT)
From: Mikulas Patocka <mpatocka@...hat.com>
To: Yu Kuai <yukuai1@...weicloud.com>,
Mike Snitzer <msnitzer@...hat.com>
cc: agk@...hat.com, dm-devel@...hat.com, linux-kernel@...r.kernel.org,
yukuai3@...wei.com, yi.zhang@...wei.com
Subject: [PATCH 2/4] dm-writecache: count the number of blocks read, not the
number of read bios
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 of bios provided inaccurate
results.
Signed-off-by: Mikulas Patocka <mpatocka@...hat.com>
Reported-by: Yu Kuai <yukuai1@...weicloud.com>
Index: linux-2.6/drivers/md/dm-writecache.c
===================================================================
--- linux-2.6.orig/drivers/md/dm-writecache.c
+++ linux-2.6/drivers/md/dm-writecache.c
@@ -1365,6 +1365,7 @@ read_next_block:
}
} 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;
}
Index: linux-2.6/Documentation/admin-guide/device-mapper/writecache.rst
===================================================================
--- linux-2.6.orig/Documentation/admin-guide/device-mapper/writecache.rst
+++ linux-2.6/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
Powered by blists - more mailing lists