From: Artur Paszkiewicz Subject: Re: [PATCH v3] md: improve io stats accounting Date: Fri, 3 Jul 2020 10:50:23 +0200 Message-ID: References: <20200702142926.4419-1-artur.paszkiewicz@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Content-Language: en-US Sender: linux-raid-owner@vger.kernel.org To: Guoqing Jiang , Song Liu Cc: linux-raid List-Id: linux-raid.ids On 7/3/20 10:33 AM, Guoqing Jiang wrote: > On 7/2/20 11:25 PM, Song Liu wrote: >> 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. > 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? Thanks, Artur