From patchwork Mon Aug 29 13:14:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Kuai X-Patchwork-Id: 12957782 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 20254ECAAD4 for ; Mon, 29 Aug 2022 13:08:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230197AbiH2NIp (ORCPT ); Mon, 29 Aug 2022 09:08:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229978AbiH2NI3 (ORCPT ); Mon, 29 Aug 2022 09:08:29 -0400 Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E68A95588; Mon, 29 Aug 2022 06:03:43 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.169]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4MGVvZ0KrHzKGDK; Mon, 29 Aug 2022 21:02:02 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.127.227]) by APP4 (Coremail) with SMTP id gCh0CgB3PY0ruQxjk7hcAA--.5381S4; Mon, 29 Aug 2022 21:03:41 +0800 (CST) From: Yu Kuai To: song@kernel.org Cc: linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org, yukuai3@huawei.com, yukuai1@huaweicloud.com, yi.zhang@huawei.com Subject: [PATCH -next 0/3] md/raid10: reduce lock contention for io Date: Mon, 29 Aug 2022 21:14:59 +0800 Message-Id: <20220829131502.165356-1-yukuai1@huaweicloud.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-CM-TRANSID: gCh0CgB3PY0ruQxjk7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Filter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-raid@vger.kernel.org From: Yu Kuai patch 1 is a small problem found by code review. patch 2 avoid holding resync_lock in fast path. patch 3 avoid holding lock in wake_up() in fast path. Test environment: Architecture: aarch64 Cpu: Huawei KUNPENG 920, there are four numa nodes Raid10 initialize: mdadm --create /dev/md0 --level 10 --bitmap none --raid-devices 4 /dev/nvme0n1 /dev/nvme1n1 /dev/nvme2n1 /dev/nvme3n1 Test cmd: fio -name=0 -ioengine=libaio -direct=1 -group_reporting=1 -randseed=2022 -rwmixread=70 -refill_buffers -filename=/dev/md0 -numjobs=16 -runtime=60s -bs=4k -iodepth=256 -rw=randread Test result: before this patchset: 2.9 GiB/s after this patchset: 6.6 Gib/s Please noted that in kunpeng-920, memory access latency is very bad accross nodes compare to local node, and in other architecture performance improvement might not be significant. Yu Kuai (3): md/raid10: fix improper BUG_ON() in raise_barrier() md/raid10: convert resync_lock to use seqlock md/raid10: prevent unnecessary calls to wake_up() in fast path drivers/md/raid10.c | 88 +++++++++++++++++++++++++++++---------------- drivers/md/raid10.h | 2 +- 2 files changed, 59 insertions(+), 31 deletions(-)