From: Mikulas Patocka <mpatocka@redhat.com>
To: Christoph Hellwig <hch@infradead.org>, Jens Axboe <axboe@kernel.dk>
Cc: 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
Subject: Re: [PATCH] the dm-loop target
Date: Mon, 3 Mar 2025 17:16:48 +0100 (CET) [thread overview]
Message-ID: <b3caee06-c798-420e-f39f-f500b3ea68ca@redhat.com> (raw)
In-Reply-To: <Z8W1q6OYKIgnfauA@infradead.org>
On Mon, 3 Mar 2025, Christoph Hellwig wrote:
> On Mon, Mar 03, 2025 at 11:24:27AM +0100, Mikulas Patocka wrote:
> > This is the dm-loop target - a replacement for the regular loop driver
> > with better performance. The dm-loop target builds a map of the file in
> > the constructor and it just remaps bios according to this map.
>
> Using ->bmap is broken and a no-go for new code.
What should I use instead of bmap? Is fiemap exported for use in the
kernel?
ext4_bmap flushes the journal if journaled data are used. Is there some
equivalent function that would provide the same guarantee w.r.t. journaled
data?
> If you have any real
> performance issues with the loop driver document and report them so that
> they can be fixed instead of working around them by duplicating the code
> (and in this case making the new code completely broken).
Would Jens Axboe agree to merge the dm-loop logic into the existing loop
driver?
Dm-loop is significantly faster than the regular loop:
# modprobe brd rd_size=1048576
# dd if=/dev/zero of=/dev/ram0 bs=1048576
# mkfs.ext4 /dev/ram0
# mount -t ext4 /dev/ram0 /mnt/test
# dd if=/dev/zero of=/mnt/test/test bs=1048576 count=512
dm-loop (on /mnt/test/test):
# dmsetup create loop --table '0 1048576 loop /mnt/test/test 0'
# fio --direct=1 --bs=4k --runtime=10 --time_based --numjobs=16
--ioengine=psync --iodepth=1 --group_reporting=1
--filename=/dev/mapper/loop --name=job --rw=rw
READ: bw=2428MiB/s (2546MB/s), 2428MiB/s-2428MiB/s (2546MB/s-2546MB/s), io=23.7GiB (25.5GB), run=10001-10001msec
WRITE: bw=2429MiB/s (2547MB/s), 2429MiB/s-2429MiB/s (2547MB/s-2547MB/s), io=23.7GiB (25.5GB), run=10001-10001msec
regular loop (on /mnt/test/test):
# losetup /dev/loop0 /mnt/test/test
# fio --direct=1 --bs=4k --runtime=10 --time_based --numjobs=16
--ioengine=psync --iodepth=1 --group_reporting=1 --filename=/dev/loop0
--name=job --rw=rw
READ: bw=326MiB/s (342MB/s), 326MiB/s-326MiB/s (342MB/s-342MB/s), io=3259MiB (3417MB), run=10003-10003msec
WRITE: bw=326MiB/s (342MB/s), 326MiB/s-326MiB/s (342MB/s-342MB/s), io=3260MiB (3418MB), run=10003-10003msec
dm-loop is even slightly faster than running fio directly on the regular
file:
# fio --direct=1 --bs=4k --runtime=10 --time_based --numjobs=16
--ioengine=psync --iodepth=1 --group_reporting=1 --filename=/mnt/test/test
--name=job --rw=rw
READ: bw=2005MiB/s (2103MB/s), 2005MiB/s-2005MiB/s (2103MB/s-2103MB/s), io=19.6GiB (21.0GB), run=10002-10002msec
WRITE: bw=2007MiB/s (2104MB/s), 2007MiB/s-2007MiB/s (2104MB/s-2104MB/s), io=19.6GiB (21.0GB), run=10002-10002msec
Mikulas
next prev parent reply other threads:[~2025-03-03 16:17 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <7d6ae2c9-df8e-50d0-7ad6-b787cb3cfab4@redhat.com>
2025-03-03 13:59 ` [PATCH] the dm-loop target Christoph Hellwig
[not found] ` <CAM23VxprhJgOPfhxQf6QNWzHd6+-ZwbjSo-oMHCD2WDQiKntMg@mail.gmail.com>
2025-03-03 15:13 ` Christoph Hellwig
2025-03-03 15:22 ` Matthew Wilcox
2025-03-03 15:31 ` Christoph Hellwig
[not found] ` <CAM23VxprSduDDK8qvLVkUt9WWmLMPFjhqKB8X4e6gw7Wv-6R2w@mail.gmail.com>
2025-03-03 17:24 ` Christoph Hellwig
[not found] ` <CAM23Vxoxyrf9nwJd1Xe8uncAPiyK8yaNZNsugwX8p=qo1n6yVg@mail.gmail.com>
2025-03-04 13:52 ` Christoph Hellwig
2025-03-03 16:16 ` Mikulas Patocka [this message]
2025-03-03 17:24 ` Christoph Hellwig
2025-03-03 21:03 ` Mikulas Patocka
2025-03-04 2:13 ` Dave Chinner
2025-03-04 11:18 ` Mikulas Patocka
2025-03-04 13:50 ` Christoph Hellwig
2025-03-05 0:01 ` Dave Chinner
2025-03-07 15:21 ` Mikulas Patocka
2025-03-08 3:49 ` Darrick J. Wong
2025-03-08 20:45 ` Mikulas Patocka
2025-03-09 0:05 ` Ming Lei
2025-03-10 11:18 ` Mikulas Patocka
2025-03-11 1:27 ` Dave Chinner
2025-03-11 10:43 ` 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
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
2025-03-09 0:16 ` Ming Lei
2025-03-10 11:20 ` Mikulas Patocka
2025-03-04 13:49 ` Christoph Hellwig
[not found] ` <CAM23Vxr=fKy-0L1R5P-5h6A95acKT_d=CC1E+TAzAs8v6q9gHw@mail.gmail.com>
2025-03-04 16:04 ` Christoph Hellwig
[not found] ` <CAM23VxqJX46DCpCiH5qxPpDLtMVg87Ba8sx55aQ4hvt-XaHzuQ@mail.gmail.com>
2025-03-04 17:17 ` Christoph Hellwig
2025-03-12 13:26 ` Kent Overstreet
2025-03-12 14:20 ` Christoph Hellwig
2025-03-12 16:09 ` Kent Overstreet
2025-03-13 12:44 ` Christoph Hellwig
2025-03-13 16:21 ` Mikulas Patocka
2025-03-13 16:33 ` Kent Overstreet
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=b3caee06-c798-420e-f39f-f500b3ea68ca@redhat.com \
--to=mpatocka@redhat.com \
--cc=agk@redhat.com \
--cc=axboe@kernel.dk \
--cc=dm-devel@lists.linux.dev \
--cc=hch@infradead.org \
--cc=heinzm@redhat.com \
--cc=jooyung@google.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).