All of lore.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <k.kozlowski@samsung.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Megha Dey <megha.dey@linux.intel.com>,
	Fenghua Yu <fenghua.yu@intel.com>,
	Tim Chen <tim.c.chen@linux.intel.com>
Subject: Re: [PATCH v2] crypto: tcrypt - Fix memory leaks/crashes in multibuffer hash speed test
Date: Wed, 29 Jun 2016 10:16:10 +0200	[thread overview]
Message-ID: <577383CA.1040204@samsung.com> (raw)
In-Reply-To: <20160628123352.GA17844@gondor.apana.org.au>

On 06/28/2016 02:33 PM, Herbert Xu wrote:
> On Tue, Jun 28, 2016 at 12:15:43PM +0200, Krzysztof Kozlowski wrote:
>> Oops:
> 
> Thanks, there was a typo where it said k instead of j in the second
> loop.
> 
> ---8<---
> This patch resolves a number of issues with the mb speed test
> function:
> 
> * The tfm is never freed.
> * Memory is allocated even when we're not using mb.
> * When an error occurs we don't wait for completion for other requests.
> * When an error occurs during allocation we may leak memory.
> * The test function ignores plen but still runs for plen != blen.
> * The backlog flag is incorrectly used (may crash).
> 
> This patch tries to resolve all these issues as well as making
> the code consistent with the existing hash speed testing function.
> 
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Seems to work fine except:
1. The updates are always 1.
2. For bigger blocks it reports always 1 or 3 cycles per byte:

[root@odroidxu3 ~]# modprobe tcrypt mode=423
[   70.129206]
[   70.129206] testing speed of multibuffer sha256 (sha256-neon)
[   70.135511] test  0 (   16 byte blocks,   16 bytes per update,   1 updates):   4597 cycles/operation,   35 cycles/byte
[   70.145826] test  2 (   64 byte blocks,   64 bytes per update,   1 updates):   5762 cycles/operation,   11 cycles/byte
[   70.156469] test  5 (  256 byte blocks,  256 bytes per update,   1 updates):  10687 cycles/operation,    5 cycles/byte
[   70.167125] test  8 ( 1024 byte blocks, 1024 bytes per update,   1 updates):  31485 cycles/operation,    3 cycles/byte
[   70.177919] test 12 ( 2048 byte blocks, 2048 bytes per update,   1 updates):  59281 cycles/operation,    3 cycles/byte
[   70.189780] test 16 ( 4096 byte blocks, 4096 bytes per update,   1 updates): 118097 cycles/operation,    3 cycles/byte
[   70.204117] test 21 ( 8192 byte blocks, 8192 bytes per update,   1 updates): 232309 cycles/operation,    3 cycles/byte

[root@odroidxu3 ~]# modprobe tcrypt mode=422
[   71.988248]
[   71.988248] testing speed of multibuffer sha1 (sha1-neon)
[   71.994097] test  0 (   16 byte blocks,   16 bytes per update,   1 updates):   2506 cycles/operation,   19 cycles/byte
[   72.004547] test  2 (   64 byte blocks,   64 bytes per update,   1 updates):   2299 cycles/operation,    4 cycles/byte
[   72.015152] test  5 (  256 byte blocks,  256 bytes per update,   1 updates):   3535 cycles/operation,    1 cycles/byte
[   72.025807] test  8 ( 1024 byte blocks, 1024 bytes per update,   1 updates):   9403 cycles/operation,    1 cycles/byte
[   72.036401] test 12 ( 2048 byte blocks, 2048 bytes per update,   1 updates):  17142 cycles/operation,    1 cycles/byte
[   72.047058] test 16 ( 4096 byte blocks, 4096 bytes per update,   1 updates):  33109 cycles/operation,    1 cycles/byte
[   72.057821] test 21 ( 8192 byte blocks, 8192 bytes per update,   1 updates):  67750 cycles/operation,    1 cycles/byte
modprobe: ERROR: could not insert 'tcrypt': Resource temporarily unavailable

Is it expected?

Best regards,
Krzysztof

  reply	other threads:[~2016-06-29  8:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-28  7:23 [PATCH 1/2] crypto: tcrypt: Fix mixing printk/pr_err and obvious indentation issues Krzysztof Kozlowski
2016-06-28  7:23 ` [PATCH 2/2] crypto: tcrypt: Fix linkage error on ARM on division of s64 Krzysztof Kozlowski
2016-06-28  8:41   ` Herbert Xu
2016-06-28  8:49     ` Krzysztof Kozlowski
2016-06-28  9:55       ` crypto: tcrypt - Fix memory leaks/crashes in multibuffer hash speed test Herbert Xu
2016-06-28 10:15         ` Krzysztof Kozlowski
2016-06-28 12:33           ` [PATCH v2] " Herbert Xu
2016-06-29  8:16             ` Krzysztof Kozlowski [this message]
2016-06-29  8:19               ` Herbert Xu
2016-06-29  8:28                 ` Krzysztof Kozlowski
2016-06-29 17:45                   ` Megha Dey
2016-06-30  3:00                     ` crypto: tcrypt - Do not bail on EINPROGRESS in multibuffer hash test Herbert Xu
2016-06-30 17:36                       ` Megha Dey
2016-06-28  8:37 ` [PATCH 1/2] crypto: tcrypt: Fix mixing printk/pr_err and obvious indentation issues Herbert Xu

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=577383CA.1040204@samsung.com \
    --to=k.kozlowski@samsung.com \
    --cc=b.zolnierkie@samsung.com \
    --cc=davem@davemloft.net \
    --cc=fenghua.yu@intel.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=megha.dey@linux.intel.com \
    --cc=tim.c.chen@linux.intel.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.