Received: by 2002:a05:6a10:83d0:0:0:0:0 with SMTP id o16csp39660pxh; Thu, 7 Apr 2022 13:18:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRNpYpBHqA9+2vGO9XSpN7UPmCvS/0GGsW8Gw/sg1eWWO6ttuiIGrnSEZ6OoxWzboamaW/ X-Received: by 2002:a17:90b:380b:b0:1ca:c6dd:d75b with SMTP id mq11-20020a17090b380b00b001cac6ddd75bmr17882079pjb.146.1649362723477; Thu, 07 Apr 2022 13:18:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649362723; cv=none; d=google.com; s=arc-20160816; b=DC/1jrrXO8gmTv+o5inxzeNmouadh7R7jWbEaEiGyyg38mqpm86sfWZG2BeiEOhgYO oIN9FwsAeAsg+X70X2OM/VHeybcj5HFOUg+a4OIqcx7+67cNqRh6Gn5E2q1sAcJEYErN Jc/aE3rY0BC23nySYE4fGq3XmJ+pI9x3YuJKHqTy1JwMEUe2nHgOJfpNwNASXGjmWJOy CxaOiY12BJEJeT4NNKqMc3yXotfuAimucOQdMToGnkQCNqN3UCF/Sun2+KrAoQyZZKdd bA2KYuDfpRob4PNrxbs9uhMpFdYsESqykaPmEn80jcYM3Rq6OYqbVqtKhmOogFYqxq1a hoFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:cc:to:from:dkim-signature; bh=S+r51FPP6n10yfgtvgNM7cq5++cCBWiReTm/0uolfQY=; b=Peicf4GZ/CkACgCsilmDDrg97YqwZ3A3hG3y5B4c3EP+FKaLb2tqrIzxkgxV/2uCeb Y0NfmJKCNv+OTeYzeZvThrwNoK3hKRifR0kmyZ2oa+ybBU04pjyQkE63mR9uK0GcAylM SbCD7jDxAhcEGQjdkVSppb2/5JcpcQhqYTldr71vDnhCCJboIiQB389XnY+2iXizxeZ0 PG8+oSToH3vN3dPLKPMl5gaXLwpoitSyPFuWJzhO3osJzZVSyz52D4tV4EOe1PZp83r5 S/9bfK90fr9uTxHAfF3NJo4i2SduQDw6gqM2L0L5oWN7iFNwXl4AoR9DU/LbZHY2EOyp 0c+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@deltatee.com header.s=20200525 header.b=rYlQCuel; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deltatee.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id n1-20020a17090a2bc100b001bd14e01f1dsi1461856pje.11.2022.04.07.13.18.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 13:18:43 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@deltatee.com header.s=20200525 header.b=rYlQCuel; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deltatee.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 700123221D4; Thu, 7 Apr 2022 12:38:24 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241754AbiDGRYv (ORCPT + 99 others); Thu, 7 Apr 2022 13:24:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346118AbiDGRYH (ORCPT ); Thu, 7 Apr 2022 13:24:07 -0400 Received: from ale.deltatee.com (ale.deltatee.com [204.191.154.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06782186DC; Thu, 7 Apr 2022 10:22:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:MIME-Version:References:In-Reply-To: Message-Id:Date:Cc:To:From:content-disposition; bh=S+r51FPP6n10yfgtvgNM7cq5++cCBWiReTm/0uolfQY=; b=rYlQCuelx0cDeN85iw8hh4CWvr LMbonNjYra2S9eW+CNjQD9KXGqbRr1Fb7DDvNPeI4frDJYTUjbAOJoy4GOqOdRnzt2m53OE1r3feS OpHYXB4oqTP9wITJxILkMQ11xCDerUtvyOpdf7Najb5IqOJsOOcHBorNqxl3SMMXryX5PoAYZ2MMh /lDd/oo1/lOeRjSqpoWhqvXSEdmid8zPpElTxESUaLWkGh7qNgzVIu86v3xp10cJ9g4BB3psd01T4 u80uTGSE+00er1CVhP+/dQwDPBJvwOYtL4r2wDxDeYc9eZ2tCUA4dVdlFtO+R4x84gmeoGPiHgOif 9WzlcTNA==; Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ncVG1-002CHm-9u; Thu, 07 Apr 2022 10:45:19 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.94.2) (envelope-from ) id 1ncVG0-0002De-41; Thu, 07 Apr 2022 10:45:16 -0600 From: Logan Gunthorpe To: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, Song Liu Cc: Shaohua Li , Guoqing Jiang , Stephen Bates , Martin Oliveira , David Sloan , Logan Gunthorpe Date: Thu, 7 Apr 2022 10:45:05 -0600 Message-Id: <20220407164511.8472-3-logang@deltatee.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220407164511.8472-1-logang@deltatee.com> References: <20220407164511.8472-1-logang@deltatee.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, song@kernel.org, shli@kernel.org, guoqing.jiang@linux.dev, sbates@raithlin.com, Martin.Oliveira@eideticom.com, David.Sloan@eideticom.com, logang@deltatee.com X-SA-Exim-Mail-From: gunthorp@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Subject: [PATCH v1 2/8] md/raid5: Move stripe_add_to_batch_list() call out of add_stripe_bio() X-SA-Exim-Version: 4.2.1 (built Sat, 13 Feb 2021 17:57:42 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org stripe_add_to_batch_list() is better done in the loop in make_request instead of inside add_stripe_bio(). This is clearer and allows for storing the batch_head state outside the loop in a subsequent patch. The call to add_stripe_bio() in retry_aligned_read() is for a read only and thus wouldn't have added the batch anyway. No functional changes intended. Signed-off-by: Logan Gunthorpe --- drivers/md/raid5.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index b794253efd15..e3c75b3b8923 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -3504,8 +3504,6 @@ static int add_stripe_bio(struct stripe_head *sh, struct bio *bi, int dd_idx, } spin_unlock_irq(&sh->stripe_lock); - if (stripe_can_batch(sh)) - stripe_add_to_batch_list(conf, sh); return 1; overlap: @@ -5918,6 +5916,9 @@ static bool raid5_make_request(struct mddev *mddev, struct bio * bi) goto retry; } + if (stripe_can_batch(sh)) + stripe_add_to_batch_list(conf, sh); + if (do_flush) { set_bit(STRIPE_R5C_PREFLUSH, &sh->state); /* we only need flush for one stripe */ -- 2.30.2