public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Dave Chinner <david@fromorbit.com>
Cc: Mikulas Patocka <mpatocka@redhat.com>,
	Christoph Hellwig <hch@infradead.org>,
	Jens Axboe <axboe@kernel.dk>, Jooyung Han <jooyung@google.com>,
	Alasdair Kergon <agk@redhat.com>,
	Mike Snitzer <snitzer@kernel.org>,
	Heinz Mauelshagen <heinzm@redhat.com>,
	zkabelac@redhat.com, dm-devel@lists.linux.dev,
	linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	io-uring@vger.kernel.org
Subject: Re: [PATCH] the dm-loop target
Date: Thu, 13 Mar 2025 09:36:22 +0800	[thread overview]
Message-ID: <Z9I2lm31KOQ784nb@fedora> (raw)
In-Reply-To: <Z9FFTiuMC8WD6qMH@fedora>

On Wed, Mar 12, 2025 at 04:27:12PM +0800, Ming Lei wrote:
> On Wed, Mar 12, 2025 at 01:34:02PM +1100, Dave Chinner wrote:

...

> 
> block layer/storage has many optimization for batching handling, if IOs
> are submitted from many contexts:
> 
> - this batch handling optimization is gone
> 
> - IO is re-ordered from underlying hardware viewpoint
> 
> - more contention from FS write lock, because loop has single back file.
> 
> That is why the single task context is taken from the beginning of loop aio,
> and it performs pretty well for sequential IO workloads, as I shown
> in the zloop example.
> 
> > 
> > > It isn't perfect, sometime it may be slower than running on io-wq
> > > directly.
> > > 
> > > But is there any better way for covering everything?
> > 
> > Yes - fix the loop queue workers.
> 
> What you suggested is threaded aio by submitting IO concurrently from
> different task context, this way is not the most efficient one, otherwise
> modern language won't invent async/.await.
> 
> In my test VM, by running Mikulas's fio script on loop/nvme by the attached
> threaded_aio patch:
> 
> NOWAIT with MQ 4		:   70K iops(read), 70K iops(write), cpu util: 40%
> threaded_aio with MQ 4	:	64k iops(read), 64K iops(write), cpu util: 52% 
> in tree loop(SQ)		:   58K	iops(read), 58K iops(write)	
> 
> Mikulas, please feel free to run your tests with threaded_aio:
> 
> 	modprobe loop nr_hw_queues=4 threaded_aio=1
> 
> by applying the attached the patch over the loop patchset.
> 
> The performance gap could be more obvious in fast hardware.

For the normal single job sequential WRITE workload, on same test VM, still
loop over /dev/nvme0n1, and running fio over loop directly:

fio --direct=1 --bs=4k --runtime=40 --time_based --numjobs=1 --ioengine=libaio \
	--iodepth=16 --group_reporting=1 --filename=/dev/loop0 -name=job --rw=write

threaded_aio(SQ)	:	81k  iops(write), cpu util: 20% 
in tree loop(SQ)	:   100K iops(write), cpu util: 7%	


Thanks,
Ming


  reply	other threads:[~2025-03-13  1:36 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <b3caee06-c798-420e-f39f-f500b3ea68ca@redhat.com>
     [not found] ` <Z8XlvU0o3C5hAAaM@infradead.org>
     [not found]   ` <8adb8df2-0c75-592d-bc3e-5609bb8de8d8@redhat.com>
     [not found]     ` <Z8Zh5T9ZtPOQlDzX@dread.disaster.area>
     [not found]       ` <1fde6ab6-bfba-3dc4-d7fb-67074036deb0@redhat.com>
     [not found]         ` <Z8eURG4AMbhornMf@dread.disaster.area>
     [not found]           ` <81b037c8-8fea-2d4c-0baf-d9aa18835063@redhat.com>
     [not found]             ` <Z8zbYOkwSaOJKD1z@fedora>
     [not found]               ` <a8e5c76a-231f-07d1-a394-847de930f638@redhat.com>
     [not found]                 ` <Z8-ReyFRoTN4G7UU@dread.disaster.area>
2025-03-11 10:43                   ` [PATCH] the dm-loop target Ming Lei
2025-03-12  2:34                     ` Dave Chinner
2025-03-12  6:24                       ` Christoph Hellwig
2025-03-12  8:26                       ` Ming Lei
2025-03-13  1:36                         ` Ming Lei [this message]
2025-03-13 16:36                         ` Mikulas Patocka
2025-03-18  4:27                           ` Dave Chinner
2025-03-18  7:57                             ` Christoph Hellwig
2025-03-18  9:34                               ` Ming Lei
2025-03-20  7:08                                 ` Christoph Hellwig
2025-03-20  7:41                                   ` Ming Lei
2025-03-20 14:22                                     ` Christoph Hellwig
2025-03-20 14:36                                       ` Ming Lei
2025-03-25 10:15                                     ` Dave Chinner
2025-03-25 12:23                                       ` 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=Z9I2lm31KOQ784nb@fedora \
    --to=ming.lei@redhat.com \
    --cc=agk@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=david@fromorbit.com \
    --cc=dm-devel@lists.linux.dev \
    --cc=hch@infradead.org \
    --cc=heinzm@redhat.com \
    --cc=io-uring@vger.kernel.org \
    --cc=jooyung@google.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mpatocka@redhat.com \
    --cc=snitzer@kernel.org \
    --cc=zkabelac@redhat.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