Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Russell King - ARM Linux <linux@armlinux.org.uk>
Cc: "Horia Geantă" <horia.geanta@nxp.com>,
	"Herbert Xu" <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	linux-crypto@vger.kernel.org
Subject: Re: [PATCH 11/14] Revert "crypto: caam - get rid of tasklet"
Date: Thu, 10 Nov 2016 00:17:59 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.20.1611092358390.3501@nanos> (raw)
In-Reply-To: <20161109085322.GY1041@n2100.armlinux.org.uk>

[-- Attachment #1: Type: text/plain, Size: 1957 bytes --]

On Wed, 9 Nov 2016, Russell King - ARM Linux wrote:
> Please include Thomas in this.

Thanks!
 
> On Wed, Nov 09, 2016 at 10:46:21AM +0200, Horia Geantă wrote:
> > This reverts commit 66d2e2028091a074aa1290d2eeda5ddb1a6c329c.
> > 
> > Quoting from Russell's findings:
> > https://www.mail-archive.com/linux-crypto@vger.kernel.org/msg21136.html
> > 
> > [quote]
> > Okay, I've re-tested, using a different way of measuring, because using
> > openssl speed is impractical for off-loaded engines.  I've decided to
> > use this way to measure the performance:
> > 
> > dd if=/dev/zero bs=1048576 count=128 | /usr/bin/time openssl dgst -md5
> > 
> > For the threaded IRQs case gives:
> > 
> > 0.05user 2.74system 0:05.30elapsed 52%CPU (0avgtext+0avgdata 2400maxresident)k
> > 0.06user 2.52system 0:05.18elapsed 49%CPU (0avgtext+0avgdata 2404maxresident)k
> > 0.12user 2.60system 0:05.61elapsed 48%CPU (0avgtext+0avgdata 2460maxresident)k
> > 	=> 5.36s => 25.0MB/s
> > 
> > and the tasklet case:
> > 
> > 0.08user 2.53system 0:04.83elapsed 54%CPU (0avgtext+0avgdata 2468maxresident)k
> > 0.09user 2.47system 0:05.16elapsed 49%CPU (0avgtext+0avgdata 2368maxresident)k
> > 0.10user 2.51system 0:04.87elapsed 53%CPU (0avgtext+0avgdata 2460maxresident)k
> > 	=> 4.95 => 27.1MB/s
> > 
> > which corresponds to an 8% slowdown for the threaded IRQ case.  So,
> > tasklets are indeed faster than threaded IRQs.

Each operation involves:

 submit job
 hard irq handler
 wakeup irq thread
 context switch
 wakeup openssl
 context switch

and that repeats over and over.

Russell has provided me traces and the extra wakeup/context switch is what
causes the slowdown vs. the tasklet case which has only one wakeup/context
switch, unless it gets outsourced to ksoftirqd which might get even slower
than the threaded handler.

You might add something like that to the changelog so it's not just a
number comparison which does not explain why this happens.

Thanks,

	tglx





  reply	other threads:[~2016-11-09 23:20 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-09  8:46 [PATCH 00/14] crypto: caam - fixes, clean-up Horia Geantă
2016-11-09  8:46 ` [PATCH 01/14] crypto: caam - fix AEAD givenc descriptors Horia Geantă
2016-11-09  8:46 ` [PATCH 02/14] crypto: caam - completely remove error propagation handling Horia Geantă
2016-11-09  8:46 ` [PATCH 03/14] crypto: caam - desc.h fixes Horia Geantă
2016-11-09  8:46 ` [PATCH 04/14] crypto: caam - fix sparse warnings Horia Geantă
2016-11-09  8:46 ` [PATCH 05/14] crypto: caam - fix smatch warnings Horia Geantă
2016-11-09  8:46 ` [PATCH 06/14] crypto: caam - remove unused may_sleep in dbg_dump_sg() Horia Geantă
2016-11-09  8:46 ` [PATCH 07/14] crypto: caam - remove unused command from aead givencrypt Horia Geantă
2016-11-09  8:46 ` [PATCH 08/14] crypto: caam - trivial code clean-up Horia Geantă
2016-11-09  8:46 ` [PATCH 09/14] crypto: caam - remove unreachable code in report_ccb_status() Horia Geantă
2016-11-09  8:46 ` [PATCH 10/14] crypto: caam - fix DMA API mapping leak in ablkcipher code Horia Geantă
2016-11-09  8:46 ` [PATCH 11/14] Revert "crypto: caam - get rid of tasklet" Horia Geantă
2016-11-09  8:53   ` Russell King - ARM Linux
2016-11-09 23:17     ` Thomas Gleixner [this message]
2016-11-09 23:19       ` Thomas Gleixner
2016-11-09  8:46 ` [PATCH 12/14] crypto: caam - move sec4_sg_entry to sg_sw_sec4.h Horia Geantă
2016-11-09  8:46 ` [PATCH 13/14] crypto: caam - constify pointer to descriptor buffer Horia Geantă
2016-11-09  8:46 ` [PATCH 14/14] crypto: caam - merge identical ahash_final/finup shared desc Horia Geantă
2016-11-13 11:35 ` [PATCH 00/14] crypto: caam - fixes, clean-up 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=alpine.DEB.2.20.1611092358390.3501@nanos \
    --to=tglx@linutronix.de \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=horia.geanta@nxp.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    /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