Message ID | 20230710064705.1847287-1-chengming.zhou@linux.dev |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp4844287vqx; Mon, 10 Jul 2023 00:27:46 -0700 (PDT) X-Google-Smtp-Source: APBJJlHs3J4iYxosdtpElsqD7LmfDqVpsbQRF12zwJika3PfXXSQLSIG7ux4AHiFMwOEjxcL/3lx X-Received: by 2002:a05:620a:2916:b0:767:3a10:d6de with SMTP id m22-20020a05620a291600b007673a10d6demr14258575qkp.58.1688974066545; Mon, 10 Jul 2023 00:27:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688974066; cv=none; d=google.com; s=arc-20160816; b=wZLPvVpWBwDIGdq6LWCSlCo+98khr20dz065nx6fSe5DL4yWzZZLrr6btlkNcywKYK dTaqHjOlXK2TuQjLC/M6LS/RqzpQ48bw7M+R2YKPZPqJ2jdWTATdenbMq7f64bFUwSLS QOQslvfFaS1VYTWz3TpsfMwOIToIyNrc0YBBwyouveItDtixYq9+S+dME74+JRfdc2sC LZvWsGi+IyvklJaolJXHs3Kq2m3r7li9wOBHzpgSLBl4gY+hCdEfuxasLG4NoXoqbiVL upTADaAEdqsEsHMNnzdKFwGgMCTQGJ7BVTlspTR6uEAAh1bhq0+Y1Fq7ivLDTpq8gj33 J9Tw== 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:dkim-signature; bh=YsPE8Ph2i63iXfOKdYTTEJ0Ca9a6Ddgy8hiayl5gTk0=; fh=4fzGWvE2LW7K10hgePOrl39slR3lbqz4nggQweyfPdc=; b=kFaVlnj3yBgud0bUt/l5X3zOg580sGUHB0r9+3/tAlEC9iKnZZ8kQxyAihgOTj3Fh/ XcufCVTLchyFScUpCcoH6sdiNXn8GSsBAp4X2cbVDytEFA98UvrxL9cUfMffQHXegaHZ AwmZsOnit5AohjmA6/+XJAuPt/Y8+NS3meXu2FduTgsfTGHZgyV3XVw1urgA4HC5fcBV iYsOjVdxG6ifyw2wTo05QV6curAZG7VWsMx/tilJdH0yP7eLN9g3oWJYEohmbxmrnbzT PiUlz7kOwfwRcRI8jAQTu0TvYUV4mnDc3gKnh2CYUaO/vi7hBNt3BeWxs3mNDYvfO6cv 2LrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=cuhHBIOJ; 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=linux.dev Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k3-20020a17090a7f0300b002507cbb009bsi6701951pjl.112.2023.07.10.00.27.34; Mon, 10 Jul 2023 00:27:46 -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=@linux.dev header.s=key1 header.b=cuhHBIOJ; 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=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230284AbjGJGrp (ORCPT <rfc822;tebrre53rla2o@gmail.com> + 99 others); Mon, 10 Jul 2023 02:47:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230179AbjGJGrn (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 10 Jul 2023 02:47:43 -0400 Received: from out-13.mta0.migadu.com (out-13.mta0.migadu.com [IPv6:2001:41d0:1004:224b::d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DBABDF for <linux-kernel@vger.kernel.org>; Sun, 9 Jul 2023 23:47:40 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1688971659; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=YsPE8Ph2i63iXfOKdYTTEJ0Ca9a6Ddgy8hiayl5gTk0=; b=cuhHBIOJFOhrK+U5yrcp1YrFeAYfgbRaVbi8wFSIIzRiiGXomhszlXZtXWc7bW8MiaoKu1 H5YLR+XnbL0xBwrUoV4G2YBymHze1pRvf6IGkzG0lFOIFELKWgLKMD6LfGfZqu4ShmuHbt J1XrC5UgdJZ4fDCmyqOnFNlJYPeO3os= From: chengming.zhou@linux.dev To: axboe@kernel.dk, hch@lst.de, ming.lei@redhat.com Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, zhouchengming@bytedance.com Subject: [PATCH 1/2] blk-flush: fix rq->flush.seq for post-flush requests Date: Mon, 10 Jul 2023 14:47:04 +0800 Message-ID: <20230710064705.1847287-1-chengming.zhou@linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771017670735822509 X-GMAIL-MSGID: 1771017670735822509 |
Series |
[1/2] blk-flush: fix rq->flush.seq for post-flush requests
|
|
Commit Message
Chengming Zhou
July 10, 2023, 6:47 a.m. UTC
From: Chengming Zhou <zhouchengming@bytedance.com> If the policy == (REQ_FSEQ_DATA | REQ_FSEQ_POSTFLUSH), it means that the data sequence and post-flush sequence need to be done for this request. The rq->flush.seq should record what sequences have been done (or don't need to be done). So in this case, pre-flush doesn't need to be done, we should init rq->flush.seq to REQ_FSEQ_PREFLUSH not REQ_FSEQ_POSTFLUSH. Of course, this doesn't cause any problem in fact, since pre-flush and post-flush sequence do the same thing for now. But we'd better fix this value, and the next patch will depend on this value to be correct. Signed-off-by: Chengming Zhou <zhouchengming@bytedance.com> --- block/blk-flush.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Mon, Jul 10, 2023 at 02:47:04PM +0800, chengming.zhou@linux.dev wrote: > From: Chengming Zhou <zhouchengming@bytedance.com> > > If the policy == (REQ_FSEQ_DATA | REQ_FSEQ_POSTFLUSH), it means that the > data sequence and post-flush sequence need to be done for this request. > > The rq->flush.seq should record what sequences have been done (or don't > need to be done). So in this case, pre-flush doesn't need to be done, > we should init rq->flush.seq to REQ_FSEQ_PREFLUSH not REQ_FSEQ_POSTFLUSH. > > Of course, this doesn't cause any problem in fact, since pre-flush and > post-flush sequence do the same thing for now. I wonder if it really doesn't cause any problems, but the change for sure looks good: Reviewed-by: Christoph Hellwig <hch@lst.de> It should probably go before your other flush optimizations and maybe grow a fixes tag.
On 2023/7/10 21:30, Christoph Hellwig wrote: > On Mon, Jul 10, 2023 at 02:47:04PM +0800, chengming.zhou@linux.dev wrote: >> From: Chengming Zhou <zhouchengming@bytedance.com> >> >> If the policy == (REQ_FSEQ_DATA | REQ_FSEQ_POSTFLUSH), it means that the >> data sequence and post-flush sequence need to be done for this request. >> >> The rq->flush.seq should record what sequences have been done (or don't >> need to be done). So in this case, pre-flush doesn't need to be done, >> we should init rq->flush.seq to REQ_FSEQ_PREFLUSH not REQ_FSEQ_POSTFLUSH. >> >> Of course, this doesn't cause any problem in fact, since pre-flush and >> post-flush sequence do the same thing for now. > > I wonder if it really doesn't cause any problems, but the change for > sure looks good: > > Reviewed-by: Christoph Hellwig <hch@lst.de> > > It should probably go before your other flush optimizations and maybe > grow a fixes tag. Ok, will add a Fixes tag and send it as a separate patch since it's a bug fix. Thanks.
On 2023/7/11 19:06, Chengming Zhou wrote: > On 2023/7/10 21:30, Christoph Hellwig wrote: >> On Mon, Jul 10, 2023 at 02:47:04PM +0800, chengming.zhou@linux.dev wrote: >>> From: Chengming Zhou <zhouchengming@bytedance.com> >>> >>> If the policy == (REQ_FSEQ_DATA | REQ_FSEQ_POSTFLUSH), it means that the >>> data sequence and post-flush sequence need to be done for this request. >>> >>> The rq->flush.seq should record what sequences have been done (or don't >>> need to be done). So in this case, pre-flush doesn't need to be done, >>> we should init rq->flush.seq to REQ_FSEQ_PREFLUSH not REQ_FSEQ_POSTFLUSH. >>> >>> Of course, this doesn't cause any problem in fact, since pre-flush and >>> post-flush sequence do the same thing for now. >> >> I wonder if it really doesn't cause any problems, but the change for >> sure looks good: >> >> Reviewed-by: Christoph Hellwig <hch@lst.de> >> >> It should probably go before your other flush optimizations and maybe >> grow a fixes tag. > > Ok, will add a Fixes tag and send it as a separate patch since it's a bug fix. > Well, I should put it in that series before other flush optimizations instead.
On Tue, Jul 11, 2023 at 07:06:20PM +0800, Chengming Zhou wrote:
> Ok, will add a Fixes tag and send it as a separate patch since it's a bug fix.
Btw, it's probably not worth resending patch 2 until we've figured out
and dealt with the SATA flush regression that Chuck reported.
On 2023/7/11 19:31, Christoph Hellwig wrote: > On Tue, Jul 11, 2023 at 07:06:20PM +0800, Chengming Zhou wrote: >> Ok, will add a Fixes tag and send it as a separate patch since it's a bug fix. > > Btw, it's probably not worth resending patch 2 until we've figured out > and dealt with the SATA flush regression that Chuck reported. Ok, I will not resend patch 2. As for the patch 1, should I resend it as a separate patch or just put it in that series [1] before other flush optimizations ? I search on the block mail list, find the issue [2] you mentioned, will look into it too. [1] https://lore.kernel.org/lkml/20230707093722.1338589-1-chengming.zhou@linux.dev/ [2] https://lore.kernel.org/linux-block/7A57C7AE-A51A-4254-888B-FE15CA21F9E9@oracle.com/
On Tue, Jul 11, 2023 at 07:52:11PM +0800, Chengming Zhou wrote: > On 2023/7/11 19:31, Christoph Hellwig wrote: > > On Tue, Jul 11, 2023 at 07:06:20PM +0800, Chengming Zhou wrote: > >> Ok, will add a Fixes tag and send it as a separate patch since it's a bug fix. > > > > Btw, it's probably not worth resending patch 2 until we've figured out > > and dealt with the SATA flush regression that Chuck reported. > > Ok, I will not resend patch 2. As for the patch 1, should I resend it as a separate patch > or just put it in that series [1] before other flush optimizations ? I'd wait a bit for debugging the regression. For the worst case we'll have to revert the patch, which currently can be done cleanly, but can't be with that patch.
diff --git a/block/blk-flush.c b/block/blk-flush.c index 4826d2d61a23..094a6adb2718 100644 --- a/block/blk-flush.c +++ b/block/blk-flush.c @@ -448,7 +448,7 @@ bool blk_insert_flush(struct request *rq) * the post flush, and then just pass the command on. */ blk_rq_init_flush(rq); - rq->flush.seq |= REQ_FSEQ_POSTFLUSH; + rq->flush.seq |= REQ_FSEQ_PREFLUSH; spin_lock_irq(&fq->mq_flush_lock); fq->flush_data_in_flight++; spin_unlock_irq(&fq->mq_flush_lock);