From patchwork Wed Jun 21 16:51:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Kuai X-Patchwork-Id: 13286875 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 6B0E0EB64D7 for ; Wed, 21 Jun 2023 08:53:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231722AbjFUIw6 (ORCPT ); Wed, 21 Jun 2023 04:52:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231747AbjFUIwo (ORCPT ); Wed, 21 Jun 2023 04:52:44 -0400 Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F164D1B4; Wed, 21 Jun 2023 01:52:43 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4QmHMC5gdhz4f43l6; Wed, 21 Jun 2023 16:52:39 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.104.67]) by APP4 (Coremail) with SMTP id gCh0CgD3rLBWupJkbVnFMA--.53622S4; Wed, 21 Jun 2023 16:52:40 +0800 (CST) From: Yu Kuai To: song@kernel.org, xni@redhat.com, pmenzel@molgen.mpg.de Cc: linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org, yukuai3@huawei.com, yukuai1@huaweicloud.com, yi.zhang@huawei.com, yangerkun@huawei.com Subject: [PATCH v2 0/8] md: fix and refactor io accounting and 'active_io' Date: Thu, 22 Jun 2023 00:51:02 +0800 Message-Id: <20230621165110.1498313-1-yukuai1@huaweicloud.com> X-Mailer: git-send-email 2.39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4UJbIYCTnIWIevJa73UjIFyTuYvj TRNgAwUUUUU X-CM-SenderInfo: 51xn3trlr6x35dzhxuhorxvhhfrp/ X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-raid@vger.kernel.org From: Yu Kuai Changes in v2: - fix some typos; - add review tag; This patchset do following things: - make io accounting for all raid levels consistent, patch 1, 3-5; - enable io accounting for all raid levels, patch 6-8; - hold 'active_io' before io start to dispatch, and release 'active_io' when io is done, make mddev_suspend() will wait for io to be done, patch 2 This patch set also prepare to synchronize io and raid configuration, make it possible to use 'active_io' in common layer to judge if normal io is in flight. Yu Kuai (8): md: move initialization and destruction of 'io_acct_set' to md.c md: also clone new io if io accounting is disabled raid5: fix missing io accounting in raid5_align_endio() md/raid1: switch to use md_account_bio() for io accounting md/raid10: switch to use md_account_bio() for io accounting md/md-multipath: enable io accounting md/md-linear: enable io accounting md/md-faulty: enable io accounting drivers/md/md-faulty.c | 2 + drivers/md/md-linear.c | 1 + drivers/md/md-multipath.c | 1 + drivers/md/md.c | 78 +++++++++++++++++++-------------------- drivers/md/md.h | 6 +-- drivers/md/raid0.c | 16 +------- drivers/md/raid1.c | 14 +++---- drivers/md/raid1.h | 1 - drivers/md/raid10.c | 20 +++++----- drivers/md/raid10.h | 1 - drivers/md/raid5.c | 70 ++++++++++------------------------- 11 files changed, 79 insertions(+), 131 deletions(-)