Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp6325020rwd; Mon, 19 Jun 2023 05:54:13 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4zOwgdQm0JkcL2bYqSM7/EUY4VuQ4TKaQuXKprF6U0n48+rpBdcphrMv5NdpxT9TydKEGp X-Received: by 2002:a17:90b:3187:b0:25e:9b1b:dee9 with SMTP id hc7-20020a17090b318700b0025e9b1bdee9mr8016377pjb.8.1687179252736; Mon, 19 Jun 2023 05:54:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687179252; cv=none; d=google.com; s=arc-20160816; b=mUMOsKhY+GGPcFGbajRCeBM9eeUdLxQSL4i+cxnDOktE8prGh7XWwz7uT9YiGBZnWv Zp9Rw3ITTpSDt7aW17b+22KeVqKr38/xrGqcShBrtCq7H1piJ5TKJ00DrrDUybRu25o9 +L+3TiJXx0+cNknW00vSM64tdwCPmFn6heFjSAsIjsBglM9wqkecncifBjoThzVsuI7K J/8BvAND77eHg77E1mg343tdDGHdTOsQswom+isLQnU08hqAMTsH3GMF6rbrJAW6E/5r s487i11BdrtgFHVn9N3kXXaBqjZDINDuy6VzmiCK2rT+jUWEPEFqXi51lXkRX8DsD7U+ nwlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=9VUwDks1rfW1HWGnsgB7wMJWz6TgEnMAY4E0O4siGo0=; b=P2srtiHwGu4l3314g4WA/yuvU4Mcs8MgJsMZtx5twkVk13ByDUBLxkhC9zJ4meWYVY 2LeKXtmCci8rwO09HQJF7qY3zgxrPyWLVULRtibQ58kDMJiYeGz6yyLNv/MANc4JTFrz CkOOm+j7ByvyhgRzshwhMNGTt6YY/ScUWFBO56LLQjj2h91rK02pnQhYG7FIXpwKVRvj gGVAnVcjkQArfMN7kH9WC1i876jf28BR+lVPUx3337cSq5MxSBhPSbxc9rwt65nu1kKE y4nI3sVGOiBXd87n7xdcK8xejdxqV1LqzGv5EVBzvbPbh+f4T0U8+GOvJNd9f4n7ACGv SQrA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ob10-20020a17090b390a00b0025653dc2881si7405272pjb.23.2023.06.19.05.53.58; Mon, 19 Jun 2023 05:54:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230192AbjFSMuF (ORCPT + 99 others); Mon, 19 Jun 2023 08:50:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231299AbjFSMty (ORCPT ); Mon, 19 Jun 2023 08:49:54 -0400 Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCF85113; Mon, 19 Jun 2023 05:49:53 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.153]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4Ql8jm4qjfz4f3m88; Mon, 19 Jun 2023 20:49:48 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.104.67]) by APP4 (Coremail) with SMTP id gCh0CgBH_rHrTpBkoNw8MA--.51801S4; Mon, 19 Jun 2023 20:49:49 +0800 (CST) From: Yu Kuai To: xni@redhat.com, song@kernel.org 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 -next 0/8] md: fix and refactor io accounting and 'active_io' Date: Tue, 20 Jun 2023 04:48:18 +0800 Message-Id: <20230619204826.755559-1-yukuai1@huaweicloud.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: gCh0CgBH_rHrTpBkoNw8MA--.51801S4 X-Coremail-Antispam: 1UD129KBjvJXoW7XF4rtr45XryDuFWfWw45ZFb_yoW8JrW7pF WfJ3yavw4rJrW7GrZxX3y8Ary5Jay8GrWqkr13t3yrZFy5ZFy5Jw48JFW8AF9rGFyfJF1f XryUWF1DuF18G37anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUvY14x267AKxVW8JVW5JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2jI8I6cxK62vIxIIY0VWUZVW8XwA2ocxC64kIII 0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26w1j6s0DM28EF7xv wVC0I7IYx2IY6xkF7I0E14v26r4UJVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4 x0Y4vEx4A2jsIEc7CjxVAFwI0_GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG 64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r 1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwACjI8F5VA0II8E6IAq YI8I648v4I1l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4 xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r1q6r43 MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I 0E14v26r1j6r4UMIIF0xvE42xK8VAvwI8IcIk0rVWrZr1j6s0DMIIF0xvEx4A2jsIE14v2 6r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0p RQo7tUUUUU= X-CM-SenderInfo: 51xn3trlr6x35dzhxuhorxvhhfrp/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, KHOP_HELO_FCRDNS,MAY_BE_FORGED,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yu Kuai 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 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(-) -- 2.39.2