Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1728285iog; Thu, 16 Jun 2022 12:29:42 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tvikFGXYh9CWnTfn/xgrkO8Ge4zeHM7sIG9dlDMPP6mKo35ImGkQCNi5FoIMptsEkEsXFR X-Received: by 2002:a05:6402:3489:b0:431:3565:4cb0 with SMTP id v9-20020a056402348900b0043135654cb0mr8356562edc.135.1655407782270; Thu, 16 Jun 2022 12:29:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655407782; cv=none; d=google.com; s=arc-20160816; b=WqiSoRlxmV71kaV7oPHPPp2zygYBUlKXtkVoI3I7fSrOZxkkdZVRBIl5sD5rWNXWU1 8g2vSNCtQD6wcfCEEBqbKdNk7S+rSCFOboO2bU0UjBPO1bag9R0f+WgYTrc28Um5uVsU WLs4sDUXAb0XCNRv5zjmvuctu9+TATtzNDnPM0vysYA6wZ609xe/nxcwvk2+ydiLM41n SwZT0AtWV5EpgJLox/jVZYIf8m/hOdbeWUYSrybRvV18c08OJvkOBFVpJO1wyOgk+0P/ d+1tw3fFf5SBNfq0LA9gRpw6lna0W7MM/W2SsTyBQgieWzSQ+AlMDcb7IsqPaD0pEEfD Fwfw== 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=daKc0MDOWNHTXxvql8ZG6tTIOLH1pnkSzHBwumdwhis=; b=1GrAEWdORmJjWCmuVcSfhpl6Z51TWpykAQrRqf8a0a6d5OWU1DHy8Lh1eKSIXhx4U+ OSA5BZxHbCtvah9pANgrVoahQSPKZF2ClwmGsefU6RGgyFv/bvSBmZK8QUxZ/CyPWvdN u2FMksY0jfs5vJhmrwQHO5huR4lYTGufyiWhQKRmm3hhnqBw+OMsB0Dm9osIo9rTeq/t 3GrtC3po2FHOsgMRA3mmT1DKSXNmxaju6Ktam9ZkpJlH5L1VjH5LICKTHnaJAj/NiJ+Q acZ65nVHZCZ17C1I9vKT8JBzkytHLFDqDBa+Pv3xTPFPLyEre3w20xF1TNynw+Ikf9TL mSbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@deltatee.com header.s=20200525 header.b=OKVCYdHi; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deltatee.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hs15-20020a1709073e8f00b006feb4205ecdsi2835313ejc.742.2022.06.16.12.29.13; Thu, 16 Jun 2022 12:29:42 -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; dkim=pass header.i=@deltatee.com header.s=20200525 header.b=OKVCYdHi; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deltatee.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378250AbiFPTUN (ORCPT + 99 others); Thu, 16 Jun 2022 15:20:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238982AbiFPTTz (ORCPT ); Thu, 16 Jun 2022 15:19:55 -0400 Received: from ale.deltatee.com (ale.deltatee.com [204.191.154.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58EE1562FC; Thu, 16 Jun 2022 12:19:52 -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=daKc0MDOWNHTXxvql8ZG6tTIOLH1pnkSzHBwumdwhis=; b=OKVCYdHimWHgCCmlVHbIgXyMG6 57j5AHkcv8vNRPWCO4NAVEQo3LAG8ng3B9R6/y8wxNmDtyhKUgRMHFUl+MG+y8tIAis2JtxRioja/ cJicaAoG15+qyiuINs1dPCASRIufqlS9Nnqzu6Gkyn6w5STxXmJjlsO9NC9q7sjZ5Dhp9JTQPGgkj ay/ibRS/o15FaA5ftsQiCpQNFn2Oh8fqUKxvz4QxPZtnNT6tBFEKyTs6ZlELPrXG0IOtZaprGRKPh JW2qf2YH0vGhmo5LVuCRDm8dXmldpGKtzgXZi2E/LZ3BOaUO5KrIXLyMrbJWkoz/GjQNrSET3ot57 PY/dydSw==; 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 1o1v1y-0092im-Qu; Thu, 16 Jun 2022 13:19:51 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.94.2) (envelope-from ) id 1o1v1v-0006FG-8Y; Thu, 16 Jun 2022 13:19:47 -0600 From: Logan Gunthorpe To: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, Song Liu Cc: Christoph Hellwig , Guoqing Jiang , Stephen Bates , Martin Oliveira , David Sloan , Logan Gunthorpe , Christoph Hellwig Date: Thu, 16 Jun 2022 13:19:34 -0600 Message-Id: <20220616191945.23935-5-logang@deltatee.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220616191945.23935-1-logang@deltatee.com> References: <20220616191945.23935-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, hch@infradead.org, guoqing.jiang@linux.dev, sbates@raithlin.com, Martin.Oliveira@eideticom.com, David.Sloan@eideticom.com, logang@deltatee.com, hch@lst.de 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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Subject: [PATCH v3 04/15] 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 read and batching only applies to write. So it's impossible for batching to happen at that call site. No functional changes intended. Signed-off-by: Logan Gunthorpe Reviewed-by: Christoph Hellwig Reviewed-by: Guoqing Jiang --- 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 25db747c5856..969609b7114b 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -3531,8 +3531,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: @@ -5950,6 +5948,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