Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp450413rwr; Wed, 26 Apr 2023 01:24:02 -0700 (PDT) X-Google-Smtp-Source: AKy350afmht1ZdBAhD+upEfC6TfUoWKcHA3DII4fcJ9KhAD3lE+D+lNNN+0jFfaDXTOf6iYtC7E1 X-Received: by 2002:a05:6a00:230a:b0:63d:4752:4db6 with SMTP id h10-20020a056a00230a00b0063d47524db6mr26037674pfh.8.1682497441735; Wed, 26 Apr 2023 01:24:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682497441; cv=none; d=google.com; s=arc-20160816; b=bFwG7rJY1tGMohri4APkbNcAJTHJlyYt+MuUfRiLTYHrDfgnBwvT2r6xIGii/Hxlml bgQ6PS18bjMB3Ka7SRXWzYfHK0K1sbiQYdPSPZJ5eSnAdaPoORF9/FAFWWcyt4vo1aQ6 llgXR4Md+1dYCfwm88oCVkgbkNoW1/BbrFUH6XhUsbyuTUIGMcYlU4PBPoIKB7EvS2P0 IhuV9pc6pRgzVoW4+mkeLeiGdXGbK/Sz9qlxlgRXhARJ3chyP4045ZasQ4GUljNPWNl5 OE1NmYFosErR8uTQUoUNIenb6glalRIYmRUSsoOTDJQiRChaxeFIKxVrWGwq7Tbf69es jWXA== 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=YipwX/BiXx6Oas6DRJIlpJ93znQnjCWCWKt56TjTQoU=; b=oUjSwq401+L09HOje1J6GKR8pB0ynKa6JWKFFUZfW6OMyHq9CV8kZh90ypvNq2x0ry yh0Uhlw018lVxzIrFQKoab9nlua4cjoDB0geFNqsjW2E79sYivGT8q3HNupCg6L5Hwm9 f2c6eIfk3nmZmk+iJGzaZyWnWB/bwwZJLeLV29QJtpvK7SZGjrojM9LDxBCZrlPQk4w5 JBGioA0NME3a5MvOwYXSxdu+7TP7czV1wNJBwtt0w24eCYb7KyMjWQXUiFesR8rTyN3z WjivxF3drgbWTMhBIe1L+Tcj3b5MNByQvcfeP+k0cGR873Hves5KX/QappDUtZ0VG3hV TMvA== 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 g23-20020aa796b7000000b0063b71d46b6dsi15567209pfk.75.2023.04.26.01.23.49; Wed, 26 Apr 2023 01:24:01 -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 S240086AbjDZIW0 (ORCPT + 99 others); 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 Content-Transfer-Encoding: 8bit X-CM-TRANSID: Syh0CgBnW+k430hkUexVIA--.50201S4 X-Coremail-Antispam: 1UD129KBjvJXoW7KF15GFy7ZFWfArWrZw17Awb_yoW8XFWUp3 y3G34agwn7A347A3Z3Zr48XFy5Jw48Jry2qrn3tr4rCFy5ZFWUZF1xGayrGr9rAry3Ja42 gr45JryUGF1UtFJanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUyK14x267AKxVW8JVW5JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26w1j6s0DM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4U JVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Gc CE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E 2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJV W8JwACjcxG0xvY0x0EwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1l42xK82IYc2Ij64vI r41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8Gjc xK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r1q6r43MIIYrxkI7VAKI48JMIIF0xvE2Ix0 cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE42xK8V AvwI8IcIk0rVWrJr0_WFyUJwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF 7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjfUoOJ5UUUUU X-CM-SenderInfo: 51xn3trlr6x35dzhxuhorxvhhfrp/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,KHOP_HELO_FCRDNS, MAY_BE_FORGED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 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(-) -- 2.39.2