Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1728271iog; Thu, 16 Jun 2022 12:29:41 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ubH2fTlpnsgOb/77qzyZBsoxlZ2Mz6YvIATjv8mT3s28k8riAA6txC3BNEgAogaLfQqiyk X-Received: by 2002:a17:906:708:b0:712:174:8745 with SMTP id y8-20020a170906070800b0071201748745mr5791992ejb.268.1655407781316; Thu, 16 Jun 2022 12:29:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655407781; cv=none; d=google.com; s=arc-20160816; b=cmgM4Y3JQQoq0wuGQJoj2SJyjLEeXpyDzjKSg+Hf8litF3XlLuS3rPVHnSUELnQY9v 02EKTM2z0bMnKK18+J8Ygg84DoKSe5Xx610Zl6RigcCACputS7diIfJ5PR5qpKHaZ/F3 G4ZacfB7UgCm//sfXx4UPFlVyMnaItyysjNHpPwFF+fxvX+NOfbbcIJbKuD/UuE6nbPA q00Nn6XrlmdxgN/f4cEx86aSMINFE5RSKFZM35K7NnivPgHXeFJDThO4zVgytYZAQjfA o2jn9YTd3rrNTdajTnoNmGnhFPTgIO6rqnwvbd9qlWsbdQQxuf/rVt+PovdXDmM1W0W8 7s0w== 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=8KJ0fqDYJYgEK4f4muGiFRawXBYi4QX35dDzYRE9OKw=; b=DJcCtcUQQBDFSmrwWMfGZIh0hBviWPFjBW6WT9gvqXd83vZ06GK9a9L0tRZYBTZPdV y1Q+Y7VT/dxjk27MDkgXa9K+E2oZX7A0u7DfbldBJ7TjUfuMs1I8ejXFQlVt49t9P1Xe 35jyDJJA1GxScSi7Ni3yJ+gPMrdf0e5cS7vuo23siFX7fE2sIckRZe9uhPcxcPC1XfS9 YLp3jsH3tavOjnmfu25my0bLawlV4aXCZcS0WTk96fxRKpcRzYNm+WC1TuEQA11GXw7e oojt7hMJxFwQJ6oJqSvGTsXxoq1FgvFyFknx9B760Ljj2fKDfbH6/zhEDeOGtbtMuLM1 70gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@deltatee.com header.s=20200525 header.b="Lnzd5/B8"; 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 sc26-20020a1709078a1a00b0070c81d9d5casi1046528ejc.686.2022.06.16.12.29.12; Thu, 16 Jun 2022 12:29:41 -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="Lnzd5/B8"; 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 S1378284AbiFPTU6 (ORCPT + 99 others); Thu, 16 Jun 2022 15:20:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377820AbiFPTT5 (ORCPT ); Thu, 16 Jun 2022 15:19:57 -0400 Received: from ale.deltatee.com (ale.deltatee.com [204.191.154.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C1AF554A4; Thu, 16 Jun 2022 12:19:54 -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=8KJ0fqDYJYgEK4f4muGiFRawXBYi4QX35dDzYRE9OKw=; b=Lnzd5/B83bcowLXlyx5PN4atmJ 6MMyU4m01OncYKsoopcqhAwnIXUuKVdh5uGLFEuunozx9qgW5saPxRPgFDPtqiuBgdZsOcV7HnKfj 2BhkePA+wvkAbP27x/EyYdqFjuA3E21Q5qY3wvcIxaRfVC5KacZ/AkO2te9Z761rY85NtE24xEPLL xI1SQf+tgA8A7kL5ARLBjV6PsBibLAGXkH+YKc/QAfQh9nqLbuuRzViOdSH6oSf2OfQ2HpBIRnjrB eUyzvpL+jd2y1gYtu8c/It8ahD+L3Jh0/0fMqjMfwxDcyS7yUVTilT16N90X0hPADZBJ2ovL3zJMW LrIaT7Zw==; 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 1o1v20-0092im-LQ; Thu, 16 Jun 2022 13:19:53 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.94.2) (envelope-from ) id 1o1v1v-0006FS-NA; 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:38 -0600 Message-Id: <20220616191945.23935-9-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 08/15] md/raid5: Move read_seqcount_begin() into make_stripe_request() 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 Now that prepare_to_wait() isn't in the way, move read_sequcount_begin() into make_stripe_request(). No functional changes intended. Signed-off-by: Logan Gunthorpe Reviewed-by: Christoph Hellwig Reviewed-by: Guoqing Jiang --- drivers/md/raid5.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index c58e70db204a..345350d34623 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -5800,14 +5800,16 @@ struct stripe_request_ctx { static enum stripe_result make_stripe_request(struct mddev *mddev, struct r5conf *conf, struct stripe_request_ctx *ctx, - sector_t logical_sector, struct bio *bi, int seq) + sector_t logical_sector, struct bio *bi) { const int rw = bio_data_dir(bi); enum stripe_result ret; struct stripe_head *sh; sector_t new_sector; int previous = 0; - int dd_idx; + int seq, dd_idx; + + seq = read_seqcount_begin(&conf->gen_lock); if (unlikely(conf->reshape_progress != MaxSector)) { /* @@ -5973,13 +5975,9 @@ static bool raid5_make_request(struct mddev *mddev, struct bio * bi) md_account_bio(mddev, &bi); prepare_to_wait(&conf->wait_for_overlap, &w, TASK_UNINTERRUPTIBLE); for (; logical_sector < last_sector; logical_sector += RAID5_STRIPE_SECTORS(conf)) { - int seq; - retry: - seq = read_seqcount_begin(&conf->gen_lock); - res = make_stripe_request(mddev, conf, &ctx, logical_sector, - bi, seq); + bi); if (res == STRIPE_FAIL) break; -- 2.30.2