Linux block layer
 help / color / mirror / Atom feed
From: Chuck Lever III <chuck.lever@oracle.com>
To: Chengming Zhou <chengming.zhou@linux.dev>
Cc: Christoph Hellwig <hch@lst.de>,
	"ross.lagerwall@citrix.com" <ross.lagerwall@citrix.com>,
	Jens Axboe <axboe@kernel.dk>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	Linux NFS Mailing List <linux-nfs@vger.kernel.org>,
	Chuck Lever <cel@kernel.org>
Subject: Re: NFS workload leaves nfsd threads in D state
Date: Wed, 12 Jul 2023 13:29:58 +0000	[thread overview]
Message-ID: <92CC9151-0309-41E9-920E-A549E2A73BE4@oracle.com> (raw)
In-Reply-To: <82cb9937-bd11-64a9-2520-bf3cf81ec720@linux.dev>



> On Jul 12, 2023, at 7:34 AM, Chengming Zhou <chengming.zhou@linux.dev> wrote:
> 
> On 2023/7/11 20:01, Christoph Hellwig wrote:
>> 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).
> 
> Hello,
> 
> I tried today to reproduce, but can't unfortunately.
> 
> Could you please also try the fix patch [1] from Ross Lagerwall that fixes
> IO hung problem of plug recursive flush?
> 
> (Since the main difference is that post-flush requests now can go into plug.)
> 
> [1] https://lore.kernel.org/all/20230711160434.248868-1-ross.lagerwall@citrix.com/

Thanks for the suggestion. No change, unfortunately.


> Thanks!
> 
>> 
>> 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);


--
Chuck Lever



  reply	other threads:[~2023-07-12 13:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-08 18:30 NFS workload leaves nfsd threads in D state Chuck Lever III
2023-07-09  6:58 ` Linux regression tracking (Thorsten Leemhuis)
2023-07-10  7:56 ` Christoph Hellwig
2023-07-10 14:06   ` Chuck Lever III
2023-07-10 15:10     ` Chuck Lever III
2023-07-10 15:18       ` Christoph Hellwig
2023-07-10 17:28       ` Christoph Hellwig
2023-07-10 17:40         ` Chuck Lever III
2023-07-11 12:01           ` Christoph Hellwig
2023-07-12 11:34             ` Chengming Zhou
2023-07-12 13:29               ` Chuck Lever III [this message]
2023-07-25  9:57                 ` Linux regression tracking (Thorsten Leemhuis)
2023-07-25 13:21                   ` Chuck Lever III
2023-07-25 13:34                     ` Linux regression tracking #update (Thorsten Leemhuis)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=92CC9151-0309-41E9-920E-A549E2A73BE4@oracle.com \
    --to=chuck.lever@oracle.com \
    --cc=axboe@kernel.dk \
    --cc=cel@kernel.org \
    --cc=chengming.zhou@linux.dev \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=ross.lagerwall@citrix.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox