From: Ming Lei <ming.lei@redhat.com>
To: Jens Axboe <axboe@kernel.dk>, linux-block@vger.kernel.org
Cc: Mikulas Patocka <mpatocka@redhat.com>,
Zhaoyang Huang <zhaoyang.huang@unisoc.com>,
Dave Chinner <dchinner@redhat.com>,
linux-fsdevel@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
Ming Lei <ming.lei@redhat.com>
Subject: [PATCH V5 0/6] loop: improve loop aio perf by IOCB_NOWAIT
Date: Wed, 15 Oct 2025 19:07:25 +0800 [thread overview]
Message-ID: <20251015110735.1361261-1-ming.lei@redhat.com> (raw)
Hello Jens,
This patchset improves loop aio perf by using IOCB_NOWAIT for avoiding to queue aio
command to workqueue context, meantime refactor lo_rw_aio() a bit.
In my test VM, loop disk perf becomes very close to perf of the backing block
device(nvme/mq virtio-scsi).
And Mikulas verified that this way can improve 12jobs sequential readwrite io by
~5X, and basically solve the reported problem together with loop MQ change.
https://lore.kernel.org/linux-block/a8e5c76a-231f-07d1-a394-847de930f638@redhat.com/
Zhaoyang Huang also mentioned it may fix their performance issue on Android
use case.
The loop MQ change will be posted as standalone patch, because it needs
UAPI change.
V5:
- only try nowait in case that backing file supports it (Yu Kuai)
- fix one lockdep assert (syzbot)
- improve comment log (Christoph)
V4:
- rebase
- re-organize and make it more readable
V3:
- add reviewed-by tag
- rename variable & improve commit log & comment on 5/5(Christoph)
V2:
- patch style fix & cleanup (Christoph)
- fix randwrite perf regression on sparse backing file
- drop MQ change
Ming Lei (6):
loop: add helper lo_cmd_nr_bvec()
loop: add helper lo_rw_aio_prep()
loop: add lo_submit_rw_aio()
loop: move command blkcg/memcg initialization into loop_queue_work
loop: try to handle loop aio command via NOWAIT IO first
loop: add hint for handling aio via IOCB_NOWAIT
drivers/block/loop.c | 233 +++++++++++++++++++++++++++++++++++--------
1 file changed, 194 insertions(+), 39 deletions(-)
--
2.47.0
next reply other threads:[~2025-10-15 11:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-15 11:07 Ming Lei [this message]
2025-10-15 11:07 ` [PATCH V5 1/6] loop: add helper lo_cmd_nr_bvec() Ming Lei
2025-10-15 15:49 ` Bart Van Assche
2025-10-16 2:19 ` Ming Lei
2025-10-15 11:07 ` [PATCH V5 2/6] loop: add helper lo_rw_aio_prep() Ming Lei
2025-10-15 11:07 ` [PATCH V5 3/6] loop: add lo_submit_rw_aio() Ming Lei
2025-10-15 11:07 ` [PATCH V5 4/6] loop: move command blkcg/memcg initialization into loop_queue_work Ming Lei
2025-10-15 11:07 ` [PATCH V5 5/6] loop: try to handle loop aio command via NOWAIT IO first Ming Lei
2025-10-15 11:07 ` [PATCH V5 6/6] loop: add hint for handling aio via IOCB_NOWAIT 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=20251015110735.1361261-1-ming.lei@redhat.com \
--to=ming.lei@redhat.com \
--cc=axboe@kernel.dk \
--cc=dchinner@redhat.com \
--cc=hch@lst.de \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=mpatocka@redhat.com \
--cc=zhaoyang.huang@unisoc.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;
as well as URLs for NNTP newsgroup(s).