From patchwork Wed Aug 9 17:16:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Jeffery X-Patchwork-Id: 13348250 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA281C001E0 for ; Wed, 9 Aug 2023 17:18:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229966AbjHIRS4 (ORCPT ); Wed, 9 Aug 2023 13:18:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229488AbjHIRSz (ORCPT ); Wed, 9 Aug 2023 13:18:55 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD2931FF5 for ; Wed, 9 Aug 2023 10:18:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691601487; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=kDY9UB0U9bakE6hcTL079JSFJy0nukOGRdOsNTOQdZ4=; b=XhS1FWPFN5ZNc+VStagdF4ehwMpo4eiiV2KbvP3Iq5qHWLde8NDofRViBkBgk9tmsUqF/V LuK8w4FZ+4kGnYW8+n0l1Iln/LFrelT268JS3zyGZV3A58XHaIIrL/bzD5NiAPawntwRrH pKxYWjXh8gQsmXfM5a2i8d23lhixcko= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-557-21XedBDOM6iVFkQffG_HKw-1; Wed, 09 Aug 2023 13:18:06 -0400 X-MC-Unique: 21XedBDOM6iVFkQffG_HKw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0311B8DC664; Wed, 9 Aug 2023 17:18:06 +0000 (UTC) Received: from fedora-work.redhat.com (unknown [10.22.16.146]) by smtp.corp.redhat.com (Postfix) with ESMTP id D469B1121314; Wed, 9 Aug 2023 17:18:05 +0000 (UTC) From: David Jeffery To: Song Liu , linux-raid@vger.kernel.org Cc: David Jeffery , Laurence Oberman Subject: [PATCH] md: raid0: account for split bio in iostat accounting Date: Wed, 9 Aug 2023 13:16:31 -0400 Message-ID: <20230809171722.11089-1-djeffery@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Precedence: bulk List-ID: X-Mailing-List: linux-raid@vger.kernel.org When a bio is split by md raid0, the newly created bio will not be tracked by md for I/O accounting. Only the portion of I/O still assigned to the original bio which was reduced by the split will be accounted for. This results in md iostat data sometimes showing I/O values far below the actual amount of data being sent through md. md_account_bio() needs to be called for all bio generated by the bio split. Signed-off-by: David Jeffery Tested-by: Laurence Oberman Reviewed-by: Laurence Oberman Reviewed-by: Yu Kuai --- drivers/md/raid0.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c index d1ac73fcd852..1fd559ac8c68 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c @@ -597,8 +597,7 @@ static bool raid0_make_request(struct mddev *mddev, struct bio *bio) bio = split; } - if (bio->bi_pool != &mddev->bio_set) - md_account_bio(mddev, &bio); + md_account_bio(mddev, &bio); orig_sector = sector; zone = find_zone(mddev->private, §or);