From: Mike Snitzer <snitzer@redhat.com>
To: Heinz Mauelshagen <heinzm@redhat.com>
Cc: dm-devel@redhat.com
Subject: Re: [PATCH 0/2] dm: add new loop and ram targets
Date: Wed, 17 Jan 2018 16:29:36 -0500 [thread overview]
Message-ID: <20180117212936.GA6756@redhat.com> (raw)
In-Reply-To: <cover.1516124587.git.heinzm@redhat.com>
On Wed, Jan 17 2018 at 2:33pm -0500,
Heinz Mauelshagen <heinzm@redhat.com> wrote:
> Enhancing IO performance compared to the kernels existing
> loop driver thus better suiting respective requirements in
> test setups, this patch series adds new "loop" and "ram" targets.
>
> For measures see test results below.
>
>
> The "loop" target maps segments to backing files.
> Mapping table example:
> 0 4192256 loop /tmp/mapper_loop1
> 4192256 2097152 loop /dev/nvm/mapper_loop0
>
>
> The "ram" target accesses RAM directly rather than through
> tmpfs additionally enhancing performance compared to "loop"
> thus avoding filesystem overhead.
> Mapping table example:
> 0 8388608 ram
>
> "ram" is a singleton target.
>
>
> Performance test results for 4K and 32K IOPS comparing the loop driver
> with dm-loop backed by tmpfs and dm-ram (all 2GiB backing size):
>
> <TESTSCRIPT>
> #!/bin/sh
> for f in /tmp/loop0 /tmp/mapper_loop0
> do
> dd if=/dev/zero of=$f bs=256M count=8 iflag=fullblock
> done
>
> losetup /dev/loop0 /tmp/loop0
> sectors=`du -s /tmp/mapper_loop0|cut -f1`
> dmsetup create loop0 --table "0 $sectors loop /tmp/mapper_loop0"
> dmsetup create ram --table "0 $sectors ram"
>
> for bs in 4K 32K
> do
> for d in /dev/loop0 /dev/mapper/loop0 /dev/mapper/ram
> do
> echo 3 > /proc/sys/vm/drop_caches
> fio --bs=$bs --rw=randrw --numjobs=99 --group_reporting --iodepth=12 --runtime=3 --ioengine=libaio \
> --loops=1 --direct=1 --exitall --name dc --filename=$d | egrep "read|write"
> done
> done
> </TESTSCRIPT>
>
> <4K_RESULTS>
> loop driver:
> read: IOPS=226k, BW=881MiB/s (924MB/s)(2645MiB/3003msec)
> write: IOPS=225k, BW=880MiB/s (923MB/s)(2643MiB/3003msec)
> dm-loop target:
> read: IOPS=425k, BW=1661MiB/s (1742MB/s)(4990MiB/3004msec)
> write: IOPS=425k, BW=1662MiB/s (1743MB/s)(4992MiB/3004msec)
> dm-ram target:
> read: IOPS=636k, BW=2484MiB/s (2605MB/s)(7464MiB/3005msec)
> write: IOPS=636k, BW=2484MiB/s (2605MB/s)(7464MiB/3005msec)
> </4K_RESULTS>
>
> <32K_RESULTS>
> loop driver:
> read: IOPS=55.5k, BW=1733MiB/s (1817MB/s)(5215MiB/3009msec)
> write: IOPS=55.2k, BW=1726MiB/s (1810MB/s)(5195MiB/3009msec)
> dm-loop target:
> read: IOPS=110k, BW=3452MiB/s (3620MB/s)(10.1GiB/3006msec)
> write: IOPS=110k, BW=3448MiB/s (3615MB/s)(10.1GiB/3006msec)
> dm-ram target:
> read: IOPS=355k, BW=10.8GiB/s (11.6GB/s)(32.6GiB/3008msec)
> write: IOPS=355k, BW=10.8GiB/s (11.6GB/s)(32.6GiB/3008msec)
> </32K_RESULTS>
>
>
> Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com>
>
> Heinz Mauelshagen (2):
> dm loop: new target redirecting io to backing file(s)
> dm ram: new target redirecting io to RAM
>
> Documentation/device-mapper/loop.txt | 20 ++
> Documentation/device-mapper/ram.txt | 15 ++
> drivers/md/Kconfig | 14 ++
> drivers/md/Makefile | 2 +
> drivers/md/dm-loop.c | 352 +++++++++++++++++++++++++++++++++++
> drivers/md/dm-ram.c | 101 ++++++++++
> 6 files changed, 504 insertions(+)
> create mode 100644 Documentation/device-mapper/loop.txt
> create mode 100644 Documentation/device-mapper/ram.txt
> create mode 100644 drivers/md/dm-loop.c
> create mode 100644 drivers/md/dm-ram.c
My initial thought for dm-ram was: why? (considering we have brd and
pmem and null_blk). But for 100 lines of code if nothing else it could
serve as yet another example DM target for those interested in learning
more about how to implement a DM target. Would be good to compare its
performance with brd, null_blk and pmem though.
As for dm-loop, doubling the performance of the loopback driver is quite
nice (especially with only 1/7 the number of lines of code as
drives/block/loop.c).
I'll review both of these closer in the coming days but it is getting
_really_ close to the 4.16 merge window (likley opens Sunday) So they
may have to wait until 4.17. We'll see.
Thanks,
Mike
next prev parent reply other threads:[~2018-01-17 21:29 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-17 19:33 [PATCH 0/2] dm: add new loop and ram targets Heinz Mauelshagen
2018-01-17 19:34 ` [PATCH 1/2] dm loop: new target redirecting io to backing file(s) Heinz Mauelshagen
2018-01-17 19:34 ` [PATCH 2/2] dm ram: new target redirecting io to RAM Heinz Mauelshagen
2018-01-17 21:29 ` Mike Snitzer [this message]
2018-01-17 23:21 ` [PATCH 0/2] dm: add new loop and ram targets Heinz Mauelshagen
2018-01-18 0:36 ` Mike Snitzer
2018-01-18 11:42 ` Bryn M. Reeves
2018-01-18 11:56 ` Mike Snitzer
2018-01-18 12:06 ` Mike Snitzer
2018-01-22 20:19 ` [dm-devel] " Christoph Hellwig
2018-01-24 12:48 ` Heinz Mauelshagen
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=20180117212936.GA6756@redhat.com \
--to=snitzer@redhat.com \
--cc=dm-devel@redhat.com \
--cc=heinzm@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).