public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Milan Broz <mbroz@redhat.com>
To: device-mapper development <dm-devel@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>,
	herbert@gondor.hengli.com.au, linux-kernel@vger.kernel.org,
	agk@redhat.com, ak@linux.intel.com
Subject: Re: [dm-devel] [PATCH] DM-CRYPT: Scale to multiple CPUs
Date: Mon, 31 May 2010 19:22:21 +0200	[thread overview]
Message-ID: <4C03F04D.4040200@redhat.com> (raw)
In-Reply-To: <20100531160425.GA20344@basil.fritz.box>

On 05/31/2010 06:04 PM, Andi Kleen wrote:
> DM-CRYPT: Scale to multiple CPUs
> 
> Currently dm-crypt does all encryption work per dmcrypt mapping in a
> single workqueue. This does not scale well when multiple CPUs
> are submitting IO at a high rate. The single CPU running the single
> thread cannot keep up with the encryption and encrypted IO performance
> tanks.

This is true only if encryption run on the CPU synchronously.

(Usually it is high speed SSD or dm-crypt above striped RAID where
underlying device throughput is higher than CPU encryption speed.)

I did a lot of experiments with similar design and abandoned it.
(If we go this way, there should be some parameter limiting
used # cpu threads for encryption, I had this configurable
through dm messages online + initial kernel module parameter.)

But I see two main problems:

1) How this scale together with asynchronous
crypto which run in parallel in crypto API layer (and have limited
resources)? (AES-NI for example)

2) Per volume threads and mempools were added to solve low memory
problems (exhausted mempools), isn't now possible deadlock here again?

(Like one CPU, many dm-crypt volumes - thread waiting for allocating
page from exhausted mempool, blocking another request (another volume)
in queue later which will free some pages after crypt processing.
This cannot happen with per volume threads. Or am I missing something here?)


Anyway, I still think that proper solution to this problem is run
parallel requests in cryptoAPI using async crypt interface,
IOW paralelize this on cryptoAPI layer which know best which resources
it can use for crypto work.

(Herbert - is something like per cpu crypto threads planned
for use in this case?)

Milan

  parent reply	other threads:[~2010-05-31 17:23 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-31 16:04 [PATCH] DM-CRYPT: Scale to multiple CPUs Andi Kleen
2010-05-31 16:34 ` Eric Dumazet
2010-05-31 17:46   ` Andi Kleen
2010-05-31 17:52     ` Eric Dumazet
2010-05-31 17:22 ` Milan Broz [this message]
2010-05-31 17:42   ` [dm-devel] " Andi Kleen
2010-05-31 18:10     ` Milan Broz
2010-05-31 18:27       ` Andi Kleen
2010-05-31 18:55         ` Milan Broz
2010-05-31 19:04           ` Andi Kleen
2010-05-31 22:07             ` Herbert Xu
2010-06-01  1:46               ` huang ying
2010-06-01  2:39         ` Mikulas Patocka
2010-06-01  2:44 ` Mikulas Patocka
2010-06-01  4:39   ` Herbert Xu
2010-06-02  5:10     ` Mikulas Patocka
2010-06-02  5:14       ` Herbert Xu
2010-06-02  5:25         ` Mikulas Patocka
2010-06-02  6:07           ` Herbert Xu
2010-06-02  6:30             ` Steffen Klassert
2010-06-02  7:07               ` Herbert Xu
2010-06-02  7:51           ` Andi Kleen
2010-06-01  6:40   ` Andi Kleen
2010-06-02  5:15     ` Mikulas Patocka
2010-06-02  5:20       ` Herbert Xu
2010-06-02  7:53       ` Andi Kleen
2010-06-02 10:20         ` 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=4C03F04D.4040200@redhat.com \
    --to=mbroz@redhat.com \
    --cc=agk@redhat.com \
    --cc=ak@linux.intel.com \
    --cc=andi@firstfloor.org \
    --cc=dm-devel@redhat.com \
    --cc=herbert@gondor.hengli.com.au \
    --cc=linux-kernel@vger.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