Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp36730365rwd; Tue, 11 Jul 2023 05:08:49 -0700 (PDT) X-Google-Smtp-Source: APBJJlFvY3XoDsmiJ+LXS86ANfqgdgyriY1qhT2h8jxit/DFLasYIRhfprdozJqnNCrS8CsBcC7X X-Received: by 2002:a05:6512:6c6:b0:4f8:eb99:19a9 with SMTP id u6-20020a05651206c600b004f8eb9919a9mr14718005lff.23.1689077329421; Tue, 11 Jul 2023 05:08:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689077329; cv=none; d=google.com; s=arc-20160816; b=zB+9mcapYQRM6l64d1C6ZbXJ4fWT/pdPy1NuYrmnNGJAgflMW7hZXuPU++qFN7QY// yqT1PCZPsJ1egaXvnwobjPoUzDdVWzsG0ULw5vxVWuBMmIsxngYDKDn6ZMmnoKzgygFV IEThmlM8I1M+1NZhoOLFhyQubTi2ycfU90agtq/OXzB4LIxtQnhtAhGCffnSF37gRPzK QriuzV+wKhN726iw/YbLSJC1LLC8GyUNm+0a0l95MLG1Bs++nt8Dhok4oIZQXAYkJCAW ccNjsm0Vp1pbW+w93nQzcyEmv7DM0rYGPPZYHPuwcD7yoj5RjeN8/I3HpmdrD6g+5h/D 1y7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=EbH//Rvffi2p0EB/ddhmmqGd435sA5D48X92lZ96Y0Q=; fh=8Pd+cu3TGWKXYyOZH5sXtVNXWHYf5aX/5eX043izhd4=; b=sqeNEkSglQrpQ9FdGnXd0j1huZloRvMX1RgjtXdnZlz6cgktitzpb5F1IIMp2G5Fa1 FNT7le89ujYjUNmxwzkoaYAaxGTzGfJQAfPmCZdfbbKeIQQjslxfKd1Dz5GRTFEYj0IL KVL+96t2u3hARSm69cGdmKAc5+30NLTm7uqZBfclNsjnw9CuFjkyFVCWE+P8pqiOBs1m SKxtvgx7VhCvI2+hZsW53jY/5MRtmlT6pSxeuYu1wpoaTxbKnJHeUMgYVqWvhuW2osVR 97FRk5aJbMZpVVXyemSUz9sjME2ee1PrXzxyuV7+1LRHAKyBWnxtRYkO933ZMiwfssNa GzsA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g7-20020aa7c587000000b0051debd504casi2007677edq.160.2023.07.11.05.08.23; Tue, 11 Jul 2023 05:08:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-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; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231418AbjGKMBo (ORCPT + 99 others); Tue, 11 Jul 2023 08:01:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230495AbjGKMBn (ORCPT ); Tue, 11 Jul 2023 08:01:43 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54C0F10CB; Tue, 11 Jul 2023 05:01:41 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 12E3967373; Tue, 11 Jul 2023 14:01:38 +0200 (CEST) Date: Tue, 11 Jul 2023 14:01:37 +0200 From: Christoph Hellwig To: Chuck Lever III Cc: Christoph Hellwig , Jens Axboe , "linux-block@vger.kernel.org" , Linux NFS Mailing List , Chuck Lever Subject: Re: NFS workload leaves nfsd threads in D state Message-ID: <20230711120137.GA27050@lst.de> References: <7A57C7AE-A51A-4254-888B-FE15CA21F9E9@oracle.com> <20230710075634.GA30120@lst.de> <3F16A14B-F854-41CC-A3CA-87C7946FC277@oracle.com> <20230710172839.GA7190@lst.de> <0F9A70B1-C6AE-4A8B-8A4B-8DC9ADED73AB@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0F9A70B1-C6AE-4A8B-8A4B-8DC9ADED73AB@oracle.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,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: X-Mailing-List: linux-nfs@vger.kernel.org On Mon, Jul 10, 2023 at 05:40:42PM +0000, Chuck Lever III wrote: > > blk_rq_init_flush(rq); > > - rq->flush.seq |= REQ_FSEQ_POSTFLUSH; > > + rq->flush.seq |= REQ_FSEQ_PREFLUSH; > > spin_lock_irq(&fq->mq_flush_lock); > > list_move_tail(&rq->flush.list, &fq->flush_data_in_flight); > > spin_unlock_irq(&fq->mq_flush_lock); > > Thanks for the quick response. No change. I'm a bit lost and still can't reprodce. Below is a patch with the only behavior differences I can find. It has two "#if 1" blocks, which I'll need to bisect to to find out which made it work (if any, but I hope so). diff --git a/block/blk-mq.c b/block/blk-mq.c index 5504719b970d59..67364e607f2d1d 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -2927,6 +2927,7 @@ void blk_mq_submit_bio(struct bio *bio) struct request_queue *q = bdev_get_queue(bio->bi_bdev); struct blk_plug *plug = blk_mq_plug(bio); const int is_sync = op_is_sync(bio->bi_opf); + bool is_flush = op_is_flush(bio->bi_opf); struct blk_mq_hw_ctx *hctx; struct request *rq; unsigned int nr_segs = 1; @@ -2967,16 +2968,23 @@ void blk_mq_submit_bio(struct bio *bio) return; } - if (op_is_flush(bio->bi_opf) && blk_insert_flush(rq)) - return; - - if (plug) { - blk_add_rq_to_plug(plug, rq); - return; +#if 1 /* Variant 1, the plug is holding us back */ + if (op_is_flush(bio->bi_opf)) { + if (blk_insert_flush(rq)) + return; + } else { + if (plug) { + blk_add_rq_to_plug(plug, rq); + return; + } } +#endif hctx = rq->mq_hctx; if ((rq->rq_flags & RQF_USE_SCHED) || +#if 1 /* Variant 2 (unlikely), blk_mq_try_issue_directly causes problems */ + is_flush || +#endif (hctx->dispatch_busy && (q->nr_hw_queues == 1 || !is_sync))) { blk_mq_insert_request(rq, 0); blk_mq_run_hw_queue(hctx, true);