All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@redhat.com>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: dm-devel@redhat.com, Alasdair G Kergon <agk@redhat.com>
Subject: Re: [PATCH 4/4] dm: implement no-clone optimization
Date: Thu, 14 Feb 2019 10:55:53 -0500	[thread overview]
Message-ID: <20190214155552.GA10827@redhat.com> (raw)
In-Reply-To: <20190214150106.703894360@debian-a64.vm>

On Thu, Feb 14 2019 at 10:00am -0500,
Mikulas Patocka <mpatocka@redhat.com> wrote:

> This patch improves performance of dm-linear and dm-striped targets.
> Device mapper copies the whole bio and passes it to the lower layer. This
> copying may be avoided in special cases.
> 
> This patch changes the logic so that instead of copying the bio we
> allocate a structure dm_noclone (it has only 4 entries), save the values
> bi_end_io and bi_private in it, overwrite these values in the bio and pass
> the bio to the lower block device.
> 
> When the bio is finished, the function noclone_endio restores te values
> bi_end_io and bi_private and passes the bio to the original bi_end_io
> function.
> 
> This optimization can only be done by dm-linear and dm-striped targets,
> the target can op-in by setting ti->no_clone = true.
> 
> Performance improvement:
> 
> # modprobe brd rd_size=1048576
> # dd if=/dev/zero of=/dev/ram0 bs=1M oflag=direct
> # dmsetup create lin --table "0 2097152 linear /dev/ram0 0"
> # fio --ioengine=psync --iodepth=1 --rw=read --bs=512 --direct=1 --numjobs=12 --time_based --runtime=10 --group_reporting --name=/dev/mapper/lin
> 
> x86-64, 2x six-core
> /dev/ram0					2449MiB/s
> /dev/mapper/lin 5.0-rc without optimization	1970MiB/s
> /dev/mapper/lin 5.0-rc with optimization	2238MiB/s
> 
> arm64, quad core:
> /dev/ram0					457MiB/s
> /dev/mapper/lin 5.0-rc without optimization	325MiB/s
> /dev/mapper/lin 5.0-rc with optimization	364MiB/s
> 
> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>

Nice performance improvement.  But each device should have its own
mempool for dm_noclone + front padding.  So it should be wired into
dm_alloc_md_mempools().

It is fine if you don't actually deal with supporting per-bio-data in
this patch, but a follow-on patch to add support for noclone-based
per-bio-data shouldn't be expected to refactor the location of the
mempool allocation (module vs per-device granularity).

Mike

  reply	other threads:[~2019-02-14 15:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-14 15:00 [PATCH 4/4] dm: implement no-clone optimization Mikulas Patocka
2019-02-14 15:55 ` Mike Snitzer [this message]
2019-02-14 16:54   ` Mikulas Patocka
2019-02-14 17:01     ` Mike Snitzer
2019-02-15 14:09       ` Mikulas Patocka

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=20190214155552.GA10827@redhat.com \
    --to=snitzer@redhat.com \
    --cc=agk@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=mpatocka@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 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.