linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zdenek Kabelac <zkabelac@redhat.com>
To: Baolin Wang <baolin.wang@linaro.org>,
	Mark Brown <broonie@kernel.org>, Jens Axboe <axboe@kernel.dk>,
	keith.busch@intel.com, Jan Kara <jack@suse.cz>,
	Arnd Bergmann <arnd@arndb.de>, Mike Snitzer <snitzer@redhat.com>,
	neilb@suse.com, LKML <linux-kernel@vger.kernel.org>,
	linux-raid@vger.kernel.org, dm-devel@redhat.com, "Garg,
	Dinesh" <dineshg@quicinc.com>,
	tj@kernel.org, bart.vanassche@sandisk.com, jmoyer@redhat.com,
	Alasdair G Kergon <agk@redhat.com>,
	Mikulas Patocka <mpatocka@redhat.com>
Subject: Re: [dm-devel] [PATCH 0/2] Introduce the request handling for dm-crypt
Date: Thu, 3 Dec 2015 12:07:10 +0100	[thread overview]
Message-ID: <5660225E.30808@redhat.com> (raw)
In-Reply-To: <CAMz4ku+5HpOJfqTd0C0i0_SMODFZw38dKqwK15Db4U37VNDVeg@mail.gmail.com>

Dne 3.12.2015 v 11:36 Baolin Wang napsal(a):
> On 3 December 2015 at 10:56, Baolin Wang <baolin.wang@linaro.org> wrote:
>> On 3 December 2015 at 03:56, Alasdair G Kergon <agk@redhat.com> wrote:
>>> On Wed, Dec 02, 2015 at 08:46:54PM +0800, Baolin Wang wrote:
>>>> These are the benchmarks for request based dm-crypt. Please check it.
>>>
>>> Now please put request-based dm-crypt completely to one side and focus
>>> just on the existing bio-based code.  Why is it slower and what can be
>>> adjusted to improve this?
>>>
>>
>> OK. I think I find something need to be point out.
>> 1. From the IO block size test in the performance report, for the
>> request based, we can find it can not get the corresponding
>> performance if we just expand the IO size. Because In dm crypt, it
>> will map the data buffer of one request with scatterlists, and send
>> all scatterlists of one request to the encryption engine to encrypt or
>> decrypt.  I found if the scatterlist list number is small and each
>> scatterlist length is bigger, it will improve the encryption speed,
>> that helps the engine palys best performance. But a big IO size does
>> not mean bigger scatterlists (maybe many scatterlists with small
>> length), that's why we can not get the corresponding performance if we
>> just expand the IO size I think.
>>
>> 2. Why bio based is slower?
>> If you understand 1, you can obviously understand the crypto engine
>> likes bigger scatterlists to improve the performance. But for bio
>> based, it only send one scatterlist (the scatterlist's length is
>> always '1 << SECTOR_SHIFT' = 512) to the crypto engine at one time. It
>> means if the bio size is 1M, the bio based will send 2048 times (evey
>> time the only one scatterlist length is 512 bytes) to crypto engine to
>> handle, which is more time-consuming and ineffective for the crypto
>> engine. But for request based, it can map the whole request with many
>> scatterlists (not just one scatterlist), and send all the scatterlists
>> to the crypto engine which can improve the performance, is it right?
>>
>> Another optimization solution I think is we can expand the scatterlist
>> entry number for bio based.
>>
>
> I did some testing about my assumption of expanding the scatterlist
> entry number for bio based. I did some modification for the bio based
> to support multiple scatterlists, then it will get the same
> performance as the request based things.
>
> 1. bio based with expanding the scatterlist entry
> time dd if=/dev/dm-0 of=/dev/null bs=64K count=16384 iflag=direct
> 1073741824 bytes (1.1 GB) copied, 94.5458 s, 11.4 MB/s
> real    1m34.562s
> user    0m0.030s
> sys     0m3.850s
>
> 2. Sequential read 1G with requset based:
> time dd if=/dev/dm-0 of=/dev/null bs=64K count=16384 iflag=direct
> 1073741824 bytes (1.1 GB) copied, 94.8922 s, 11.3 MB/s
> real    1m34.908s
> user    0m0.030s
> sys     0m4.000s
>
>  From the data, we can find the bio based also can get the same
> performance as the request based. So if someone still don't like the
> request based things, I think we can optimize the bio based by
> expanding the scatterlists number. Thanks.
>


Hi

Do you see any performance impact if you use with cryptsetup options:

  --perf-same_cpu_crypt
  --perf-submit_from_crypt_cpus

with your regular unpatched kernel.

Zdenek

  reply	other threads:[~2015-12-03 11:07 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-11  9:31 [PATCH 0/2] Introduce the request handling for dm-crypt Baolin Wang
2015-11-11  9:31 ` [PATCH 1/2] block: Introduce BIO_ENDIO_FREE for bio flags Baolin Wang
2015-11-11 17:54   ` Mike Snitzer
2015-11-12  4:05     ` Baolin Wang
2015-11-11  9:31 ` [PATCH 2/2] md: dm-crypt: Introduce the request handling for dm-crypt Baolin Wang
2015-11-11  9:48 ` [PATCH 0/2] " Christoph Hellwig
2015-11-12  2:15   ` Baolin Wang
2015-11-12  9:17     ` Jan Kara
2015-11-12  9:40       ` Baolin Wang
2015-11-12 11:06         ` Jan Kara
2015-11-12 11:46           ` Baolin Wang
2015-11-12 12:24             ` Jan Kara
2015-11-12 12:51               ` Baolin Wang
2015-11-12 12:57                 ` Arnd Bergmann
2015-11-12 15:02                   ` Mark Brown
2015-11-13  3:27                     ` Baolin Wang
2015-11-13  3:25                   ` Baolin Wang
2015-11-12 12:59                 ` Jan Kara
2015-11-13  2:05                   ` Baolin Wang
2015-11-13  9:05                     ` Arnd Bergmann
2015-11-13 11:37                       ` Baolin Wang
2015-11-11 18:18 ` Mike Snitzer
2015-11-12  2:36   ` Baolin Wang
2015-11-12  9:06     ` [dm-devel] " Christoph Hellwig
2015-11-12  8:20   ` Baolin Wang
2015-11-12 10:04     ` Mark Brown
2015-11-12 15:26       ` Jens Axboe
2015-11-13  2:07         ` Baolin Wang
2015-11-13 11:51         ` Mark Brown
2015-12-02 12:46           ` Baolin Wang
2015-12-02 19:56             ` [dm-devel] " Alasdair G Kergon
2015-12-03  2:56               ` Baolin Wang
2015-12-03 10:36                 ` Baolin Wang
2015-12-03 11:07                   ` Zdenek Kabelac [this message]
2015-12-03 11:27                     ` Baolin Wang
2015-12-03 15:49                   ` Mikulas Patocka
2015-12-04  4:58                     ` Baolin Wang
2015-12-03 15:47                 ` Mikulas Patocka
2015-12-04  4:57                   ` Baolin Wang
2015-11-12  9:05   ` Christoph Hellwig

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=5660225E.30808@redhat.com \
    --to=zkabelac@redhat.com \
    --cc=agk@redhat.com \
    --cc=arnd@arndb.de \
    --cc=axboe@kernel.dk \
    --cc=baolin.wang@linaro.org \
    --cc=bart.vanassche@sandisk.com \
    --cc=broonie@kernel.org \
    --cc=dineshg@quicinc.com \
    --cc=dm-devel@redhat.com \
    --cc=jack@suse.cz \
    --cc=jmoyer@redhat.com \
    --cc=keith.busch@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=mpatocka@redhat.com \
    --cc=neilb@suse.com \
    --cc=snitzer@redhat.com \
    --cc=tj@kernel.org \
    /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).