linux/drivers/md/bcache
Coly Li a2f32ee8fd bcache: fix bio_{start,end}_io_acct with proper device
Commit 85750aeb74 ("bcache: use bio_{start,end}_io_acct") moves the
io account code to the location after bio_set_dev(bio, dc->bdev) in
cached_dev_make_request(). Then the account is performed incorrectly on
backing device, indeed the I/O should be counted to bcache device like
/dev/bcache0.

With the mistaken I/O account, iostat does not display I/O counts for
bcache device and all the numbers go to backing device. In writeback
mode, the hard drive may have 340K+ IOPS which is impossible and wrong
for spinning disk.

This patch introduces bch_bio_start_io_acct() and bch_bio_end_io_acct(),
which switches bio->bi_disk to bcache device before calling
bio_start_io_acct() or bio_end_io_acct(). Now the I/Os are counted to
bcache device, and bcache device, cache device and backing device have
their correct I/O count information back.

Fixes: 85750aeb74 ("bcache: use bio_{start,end}_io_acct")
Signed-off-by: Coly Li <colyli@suse.de>
Cc: Christoph Hellwig <hch@lst.de>
Cc: stable@vger.kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-07-25 07:38:21 -06:00
..
alloc.c bcache: add bucket_size_hi into struct cache_sb_disk for large bucket 2020-07-25 07:38:21 -06:00
bcache.h bcache: handle cache prio_buckets and disk_buckets properly for bucket size > 8MB 2020-07-25 07:38:20 -06:00
bset.c bcache: allocate meta data pages as compound pages 2020-07-25 07:38:19 -06:00
bset.h bcache: explicity type cast in bset_bkey_last() 2020-02-01 07:55:39 -07:00
btree.c bcache: handle cache set verify_ondisk properly for bucket size > 8MB 2020-07-25 07:38:20 -06:00
btree.h bcache: remove dupplicated declaration from btree.h 2020-03-24 19:56:42 -06:00
closure.c bcache: don't export symbols 2019-11-13 15:42:51 -07:00
closure.h bcache: fix typo in code comments of closure_return_with_destructor() 2018-10-08 08:19:43 -06:00
debug.c bcache: Fix an error code in bch_dump_read() 2019-09-03 08:08:29 -06:00
debug.h bcache: add identifier names to arguments of function definitions 2018-08-11 15:46:41 -06:00
extents.c bcache: Convert pr_<level> uses to a more typical style 2020-05-27 05:19:36 -06:00
extents.h bcache: add identifier names to arguments of function definitions 2018-08-11 15:46:41 -06:00
features.c bcache: add sysfs file to display feature sets information of cache set 2020-07-25 07:38:21 -06:00
features.h bcache: add sysfs file to display feature sets information of cache set 2020-07-25 07:38:21 -06:00
io.c bcache: avoid extra memory consumption in struct bbio for large bucket size 2020-07-25 07:38:21 -06:00
journal.c bcache: journel: use for_each_clear_bit() to simplify the code 2020-07-25 07:38:19 -06:00
journal.h Revert "bcache: fix fifo index swapping condition in journal_pin_cmp()" 2019-11-18 08:35:47 -07:00
Kconfig bcache: Fix typo in Kconfig name 2020-07-25 07:38:19 -06:00
Makefile bcache: add sysfs file to display feature sets information of cache set 2020-07-25 07:38:21 -06:00
movinggc.c bcache: add bucket_size_hi into struct cache_sb_disk for large bucket 2020-07-25 07:38:21 -06:00
request.c bcache: fix bio_{start,end}_io_acct with proper device 2020-07-25 07:38:21 -06:00
request.h block: move ->make_request_fn to struct block_device_operations 2020-07-01 07:27:24 -06:00
stats.c bcache: fix memory corruption in bch_cache_accounting_clear() 2020-02-01 07:55:39 -07:00
stats.h bcache: add identifier names to arguments of function definitions 2018-08-11 15:46:41 -06:00
super.c bcache: avoid extra memory consumption in struct bbio for large bucket size 2020-07-25 07:38:21 -06:00
sysfs.c bcache: add sysfs file to display feature sets information of cache set 2020-07-25 07:38:21 -06:00
sysfs.h bcache: add sysfs_strtoul_bool() for setting bit-field variables 2019-02-09 07:18:32 -07:00
trace.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
util.c bcache: avoid to use bio_for_each_segment_all() in bch_bio_alloc_pages() 2019-02-15 08:40:11 -07:00
util.h bcache: Revert "bcache: fix high CPU occupancy during journal" 2019-06-28 07:39:17 -06:00
writeback.c bcache: fix overflow in offset_to_stripe() 2020-07-25 07:38:20 -06:00
writeback.h bcache: fix overflow in offset_to_stripe() 2020-07-25 07:38:20 -06:00