All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: "Theodore Ts'o" <tytso@mit.edu>,
	Steffen Klassert <steffen.klassert@secunet.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Jaegeuk Kim <jaegeuk@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
	linux-ext4@vger.kernel.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	linux-f2fs-devel@lists.sourceforge.net, ecryptfs@vger.kernel.org,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] crypto: allow to assign gfp_t for __crypto_alloc_tfm
Date: Wed, 20 May 2015 17:30:14 +0200	[thread overview]
Message-ID: <CAKv+Gu_TDwaftr=f8yG8Vna8e+PcKGXD-uggP2oB-2Tq7DWMtA@mail.gmail.com> (raw)
In-Reply-To: <20150520145901.GI2871@thunk.org>

On 20 May 2015 at 16:59, Theodore Ts'o <tytso@mit.edu> wrote:
> On Wed, May 20, 2015 at 09:21:20AM +0200, Steffen Klassert wrote:
>> The current pcrypt version is used just for IPsec because it supports
>> only AEAD type algorithms and does not support request backlog. But
>> I have patches to support ablkcipher algorithms and request backlog.
>> I could provide them if there is interest in it.
>
> I don't know the crypto layer well enough, and I certainly don't know
> how to deal with things like ARM CPU's with "big-little" architectures
> to understand what we might need to do to power optimize things for
> mobile handsets.  But if someone has time to look at this, that would
> be great.
>

I'd be interested in getting involved: I'm fairly intimate with the
crypto layer and the ARM/arm64 architectures, since I wrote a big
chunk of the ARM/arm64 CPU based crypto drivers.

However, it's quite a can of worms you're opening here. Speed is
easily quantified, and it may even be feasible to introduce some kind
of boottime benchmark to select the fastest implementation available
(like already exists for xor and raid6, for instance).
@Herbert: was something like this ever proposed? And would you
consider merging it if it were implemented adequately?

Power efficiency is *much* harder, since you're not only dealing with
big.LITTLE, but also NEON versus ALU (i.e., SIMD math versus integer
math) and CPU versus hw accelerator based crypto. (We have the NEON
based bit sliced AES as an example: we know it does fundamentally more
work by calculating values that the table based AES implementation
reads from a lookup table, so while it is a lot faster on most NEON
implementations, it is most likely not as power efficient) Even if it
were possible to quantify the power efficiency in the first place,
whether the most power efficient implementation should be preferred
over the fastest one is a policy decision which does not really belong
inside the kernel.

Are there any background materials or other references you can share
that shed a bit more light on this?

WARNING: multiple messages have this Message-ID (diff)
From: ard.biesheuvel@linaro.org (Ard Biesheuvel)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] crypto: allow to assign gfp_t for __crypto_alloc_tfm
Date: Wed, 20 May 2015 17:30:14 +0200	[thread overview]
Message-ID: <CAKv+Gu_TDwaftr=f8yG8Vna8e+PcKGXD-uggP2oB-2Tq7DWMtA@mail.gmail.com> (raw)
In-Reply-To: <20150520145901.GI2871@thunk.org>

On 20 May 2015 at 16:59, Theodore Ts'o <tytso@mit.edu> wrote:
> On Wed, May 20, 2015 at 09:21:20AM +0200, Steffen Klassert wrote:
>> The current pcrypt version is used just for IPsec because it supports
>> only AEAD type algorithms and does not support request backlog. But
>> I have patches to support ablkcipher algorithms and request backlog.
>> I could provide them if there is interest in it.
>
> I don't know the crypto layer well enough, and I certainly don't know
> how to deal with things like ARM CPU's with "big-little" architectures
> to understand what we might need to do to power optimize things for
> mobile handsets.  But if someone has time to look at this, that would
> be great.
>

I'd be interested in getting involved: I'm fairly intimate with the
crypto layer and the ARM/arm64 architectures, since I wrote a big
chunk of the ARM/arm64 CPU based crypto drivers.

However, it's quite a can of worms you're opening here. Speed is
easily quantified, and it may even be feasible to introduce some kind
of boottime benchmark to select the fastest implementation available
(like already exists for xor and raid6, for instance).
@Herbert: was something like this ever proposed? And would you
consider merging it if it were implemented adequately?

Power efficiency is *much* harder, since you're not only dealing with
big.LITTLE, but also NEON versus ALU (i.e., SIMD math versus integer
math) and CPU versus hw accelerator based crypto. (We have the NEON
based bit sliced AES as an example: we know it does fundamentally more
work by calculating values that the table based AES implementation
reads from a lookup table, so while it is a lot faster on most NEON
implementations, it is most likely not as power efficient) Even if it
were possible to quantify the power efficiency in the first place,
whether the most power efficient implementation should be preferred
over the fastest one is a policy decision which does not really belong
inside the kernel.

Are there any background materials or other references you can share
that shed a bit more light on this?

  reply	other threads:[~2015-05-20 15:30 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-19  5:46 [PATCH] crypto: allow to assign gfp_t for __crypto_alloc_tfm Jaegeuk Kim
2015-05-19  5:46 ` Jaegeuk Kim
2015-05-19  5:49 ` Herbert Xu
2015-05-19  5:49   ` Herbert Xu
2015-05-19  6:24   ` Jaegeuk Kim
2015-05-19  6:24     ` Jaegeuk Kim
2015-05-19  6:31     ` [f2fs-dev] [PATCH v2] " Jaegeuk Kim
2015-05-19  6:31       ` Jaegeuk Kim
2015-05-19  6:32       ` Herbert Xu
2015-05-19  6:32         ` [f2fs-dev] " Herbert Xu
2015-05-19  6:32         ` Herbert Xu
2015-05-19  6:32     ` [PATCH] " Herbert Xu
2015-05-19  6:32       ` Herbert Xu
2015-05-19  6:58       ` Jaegeuk Kim
2015-05-19  6:58         ` Jaegeuk Kim
2015-05-19  6:59         ` Herbert Xu
2015-05-19  6:59           ` Herbert Xu
2015-05-19  7:13           ` Jaegeuk Kim
2015-05-19  7:13             ` Jaegeuk Kim
2015-05-19  7:15             ` Herbert Xu
2015-05-19  7:15               ` Herbert Xu
2015-05-19  7:27               ` Jaegeuk Kim
2015-05-19  7:27                 ` Jaegeuk Kim
2015-05-19  7:30                 ` Herbert Xu
2015-05-19  7:30                   ` Herbert Xu
2015-05-19  7:59                   ` Jaegeuk Kim
2015-05-19  7:59                     ` Jaegeuk Kim
2015-05-19 14:14               ` Theodore Ts'o
2015-05-19 14:14                 ` Theodore Ts'o
2015-05-19 14:27                 ` Herbert Xu
2015-05-19 14:27                   ` Herbert Xu
2015-05-19 14:39                   ` Theodore Ts'o
2015-05-19 14:39                     ` Theodore Ts'o
2015-05-20  7:21                   ` Steffen Klassert
2015-05-20  7:21                     ` Steffen Klassert
2015-05-20  7:21                     ` Steffen Klassert
2015-05-20 14:59                     ` Theodore Ts'o
2015-05-20 14:59                       ` Theodore Ts'o
2015-05-20 15:30                       ` Ard Biesheuvel [this message]
2015-05-20 15:30                         ` Ard Biesheuvel
2015-05-20 15:30                         ` Ard Biesheuvel
2015-05-20 15:42                         ` Herbert Xu
2015-05-20 15:42                           ` Herbert Xu
2015-05-20 15:42                           ` 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='CAKv+Gu_TDwaftr=f8yG8Vna8e+PcKGXD-uggP2oB-2Tq7DWMtA@mail.gmail.com' \
    --to=ard.biesheuvel@linaro.org \
    --cc=davem@davemloft.net \
    --cc=ecryptfs@vger.kernel.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=jaegeuk@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=steffen.klassert@secunet.com \
    --cc=tytso@mit.edu \
    /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.