Re: [PATCH v3] md: improve io stats accounting
From: Guoqing Jiang <hidden>
Date: 2020-07-03 08:58:51
On 7/3/20 10:50 AM, Artur Paszkiewicz wrote:
On 7/3/20 10:33 AM, Guoqing Jiang wrote:quoted
On 7/2/20 11:25 PM, Song Liu wrote:quoted
I run quick test with this. Seems it only adds proper statistics to raid5 array, but not to raid0 array. Is this expected?Oh, sorry about that. Of course it should work.quoted
Because bio_endio is not called, and it is same for linear and faulty. I think we have to clone bio for them ..., then it is better to do the job in the personality layer.It's not that bad actually. The issue is simply because those personalities change the original bio's bi_disk and then bio_end_io_acct() uses a different gendisk. So I think we can either use disk_{start,end}_io_acct() instead of bio_{start,end}_io_acct(), or change bio->bi_disk back to mddev->gendisk before calling bio_end_io_acct(). I prefer the first option. What do you think?
I am fine with either of them, though currently the only caller of disk_start_io_acct is bio_start_io_acct :-) Thanks, Guoqing