From patchwork Wed Apr 26 08:20:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Kuai X-Patchwork-Id: 13224226 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 37FD1C7618E for ; Wed, 26 Apr 2023 08:22:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240030AbjDZIW0 (ORCPT ); Wed, 26 Apr 2023 04:22:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239964AbjDZIWZ (ORCPT ); Wed, 26 Apr 2023 04:22:25 -0400 Received: from dggsgout12.his.huawei.com (unknown [45.249.212.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E92CD198C; Wed, 26 Apr 2023 01:22:23 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.153]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4Q5sL31NZnz4f4MCX; Wed, 26 Apr 2023 16:22:19 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.104.67]) by APP2 (Coremail) with SMTP id Syh0CgBnW+k430hkUexVIA--.50201S4; Wed, 26 Apr 2023 16:22:18 +0800 (CST) From: Yu Kuai To: song@kernel.org, akpm@osdl.org, neilb@suse.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 -next v2 0/7] limit the number of plugged bio Date: Wed, 26 Apr 2023 16:20:24 +0800 Message-Id: <20230426082031.1299149-1-yukuai1@huaweicloud.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X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derInfo: 51xn3trlr6x35dzhxuhorxvhhfrp/ X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-raid@vger.kernel.org From: Yu Kuai Changes in v2: - remove the patch to rename raid1-10.c This patchset tries to limit the number of plugged bio for raid1 and raid10, which is done in the last patch, other patches are some refactor and optimizations. This patchset is tested with a new test [1], this test triggers dirty pages writeback for 10s, and in the meantime checks disk inflight. Before this patchset, test will fail because inflight exceed threshold (threshold is set to 4096 in the test, in theory this can be mutch greater as long as there are enough dirty pages and memory). After this patchset, inflight is within 96 (MAX_PLUG_BIO * copies). [1] https://lore.kernel.org/linux-raid/20230426073447.1294916-1-yukuai1@huaweicloud.com/ Yu Kuai (7): md/raid10: prevent soft lockup while flush writes md/raid1-10: factor out a helper to add bio to plug md/raid1-10: factor out a helper to submit normal write md/raid1-10: submit write io directly if bitmap is not enabled md/md-bitmap: add a new helper to unplug bitmap asynchrously md/raid1-10: don't handle pluged bio by daemon thread md/raid1-10: limit the number of plugged bio drivers/md/md-bitmap.c | 55 +++++++++++++++++++++++++++++++++---- drivers/md/md-bitmap.h | 10 +++++++ drivers/md/raid1-10.c | 62 ++++++++++++++++++++++++++++++++++++++++++ drivers/md/raid1.c | 29 ++++---------------- drivers/md/raid10.c | 47 +++++++------------------------- 5 files changed, 136 insertions(+), 67 deletions(-)