All of lore.kernel.org
 help / color / mirror / Atom feed
From: Milan Broz <mbroz@redhat.com>
To: device-mapper development <dm-devel@redhat.com>
Cc: dm-crypt@saout.de
Subject: Re: SMP-aware kcryptd?
Date: Mon, 13 Apr 2009 19:36:36 +0200	[thread overview]
Message-ID: <49E37824.8010100@redhat.com> (raw)
In-Reply-To: <49E3410D.9040500@wpkg.org>

Tomasz Chmielewski wrote:
> Currently, the trend with CPUs is to add more cores rather than increase 
> the speed of a single core.
> 
> This does not scale very well with certain things in the Linux kernel. 
> One of them is kcryptd.
> 
> 
> A system able to deliver data with a speed of ~200 MB/s from a RAID 
> array, will be only able to deliver a fraction of it (i.e. ~40 MB/s in 
> my case) when reads are being done from a dm-crypt device.
> 
> This is because kcryptd is not SMP-aware: it performs all calculations 
> on a single logical CPU only.
> 
> Are there any plans to change it?

Yes, I think I already commented this in some thread,
there are basically 2 possible approaches:

1) create several "encryption" threads in dm-crypt (e.g. per CPU core) or
2) parallelize async crypto requests processing (in crypto layer)

I have some patches for 1) but the result is not what I expected
- performance highly depends on write pattern for example.
In short, the code need more thought.
(I tried to parallelize sector encryption _vs_ whole bio request encryption,
and there are still some problem with both. Also barriers and reordering
of requests can be problem here.)

Another problem with 1) is what happens when there is hw acceleration -
multiple threads are useful only if main cpu runs encryption,
for hw & async crypto requests it can cause problems.

The crypto driver is completely transparent - dm-crypt have no idea
if encryption runs on main cpu or in an accelerator hw
(=> solution 2) is more generic).

Anyway, it is not highest priority currently... but still in slow progress.
(but I guess high speed SSDs will increase priority for this too,
currently it is real problem only for RAID arrays:-)

Milan
--
mbroz@redhat.com

  reply	other threads:[~2009-04-13 17:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-13 13:41 SMP-aware kcryptd? Tomasz Chmielewski
2009-04-13 17:36 ` Milan Broz [this message]
2009-04-13 17:47   ` Tomasz Chmielewski
2009-04-13 19:33   ` Larry Dickson

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=49E37824.8010100@redhat.com \
    --to=mbroz@redhat.com \
    --cc=dm-crypt@saout.de \
    --cc=dm-devel@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.