summaryrefslogtreecommitdiff
path: root/drivers/md/raid10.h
diff options
context:
space:
mode:
authorColy Li <colyli@suse.de>2020-07-25 15:00:39 +0300
committerJens Axboe <axboe@kernel.dk>2020-07-25 16:38:21 +0300
commita2f32ee8fd853cec8860f883d98afc3a339546de (patch)
treee66e47a1c79a051ee9d69221df1b6b253a31ff49 /drivers/md/raid10.h
parent4e4d4e0962262c97ba4580716d11623384effdfd (diff)
downloadlinux-a2f32ee8fd853cec8860f883d98afc3a339546de.tar.xz
bcache: fix bio_{start,end}_io_acct with proper device
Commit 85750aeb748f ("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: 85750aeb748f ("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>
Diffstat (limited to 'drivers/md/raid10.h')
0 files changed, 0 insertions, 0 deletions