linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Keith Busch <kbusch@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	linux-mm@kvack.org, linux-xfs@vger.kernel.org,
	Changhui Zhong <czhong@redhat.com>
Subject: Re: [PATCH V2] block: ignore RWF_HIPRI hint for sync dio
Date: Tue, 24 May 2022 08:40:46 +0800	[thread overview]
Message-ID: <YowpjtLfZPld1H6T@T590> (raw)
In-Reply-To: <YowMVODoNIyaqVdC@kbusch-mbp.dhcp.thefacebook.com>

On Mon, May 23, 2022 at 04:36:04PM -0600, Keith Busch wrote:
> On Wed, Apr 20, 2022 at 10:31:10PM +0800, Ming Lei wrote:
> > So far bio is marked as REQ_POLLED if RWF_HIPRI/IOCB_HIPRI is passed
> > from userspace sync io interface, then block layer tries to poll until
> > the bio is completed. But the current implementation calls
> > blk_io_schedule() if bio_poll() returns 0, and this way causes io hang or
> > timeout easily.
> 
> Wait a second. The task's current state is TASK_RUNNING when bio_poll() returns
> zero, so calling blk_io_schedule() isn't supposed to hang.

void __sched io_schedule(void)
{
        int token;

        token = io_schedule_prepare();
        schedule();
        io_schedule_finish(token);
}

But who can wakeup this task after scheduling out? There can't be irq
handler for POLLED request.

The hang can be triggered on nvme/qemu reliably:

fio --bs=4k --size=1G --ioengine=pvsync2 --norandommap --hipri=1 --iodepth=64 \
	--slat_percentiles=1 --nowait=0 --filename=/dev/nvme0n1 --direct=1 \
	--runtime=10 --numjobs=1 --rw=rw --name=test --group_reporting

Thanks, 
Ming



  reply	other threads:[~2022-05-24  0:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-20 14:31 Ming Lei
2022-04-21  7:02 ` Christoph Hellwig
2022-04-21 11:48 ` Changhui Zhong
2022-05-02 16:01 ` Ming Lei
2022-05-02 16:07 ` Jens Axboe
2022-05-23 22:36 ` Keith Busch
2022-05-24  0:40   ` Ming Lei [this message]
2022-05-24  3:02     ` Keith Busch
2022-05-24  4:34       ` Keith Busch
2022-05-24  6:28         ` Ming Lei
2022-05-24 15:20           ` Keith Busch
2022-05-24  6:10       ` Ming Lei

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=YowpjtLfZPld1H6T@T590 \
    --to=ming.lei@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=czhong@redhat.com \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-xfs@vger.kernel.org \
    /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