All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Hao Xu <haoxu@linux.alibaba.com>, io-uring@vger.kernel.org
Cc: viro@zeniv.linux.org.uk, akpm@linux-foundation.org,
	hannes@cmpxchg.org, linux-fsdevel@vger.kernel.org,
	linux-mm@kvack.org
Subject: Re: [PATCH] io_uring: support async buffered reads when readahead is disabled
Date: Tue, 29 Sep 2020 07:51:55 -0600	[thread overview]
Message-ID: <6ef7da28-f6a6-827e-4881-dd78a4b92bf5@kernel.dk> (raw)
In-Reply-To: <1601380845-206925-1-git-send-email-haoxu@linux.alibaba.com>

On 9/29/20 6:00 AM, Hao Xu wrote:
> The async buffered reads feature is not working when readahead is
> turned off. There are two things to concern:
> 
> - when doing retry in io_read, not only the IOCB_WAITQ flag but also
>   the IOCB_NOWAIT flag is still set, which makes it goes to would_block
>   phase in generic_file_buffered_read() and then return -EAGAIN. After
>   that, the io-wq thread work is queued, and later doing the async
>   reads in the old way.
> 
> - even if we remove IOCB_NOWAIT when doing retry, the feature is still
>   not running properly, since in generic_file_buffered_read() it goes to
>   lock_page_killable() after calling mapping->a_ops->readpage() to do
>   IO, and thus causing process to sleep.

Thanks, this looks great, and avoids cases of io-wq punt where we don't
need it. I'm going to run this through full testing, but I think this
looks good to me.

-- 
Jens Axboe


      reply	other threads:[~2020-09-29 13:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-29 12:00 [PATCH] io_uring: support async buffered reads when readahead is disabled Hao Xu
2020-09-29 13:51 ` Jens Axboe [this message]

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=6ef7da28-f6a6-827e-4881-dd78a4b92bf5@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=haoxu@linux.alibaba.com \
    --cc=io-uring@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=viro@zeniv.linux.org.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.