From: Joonsoo Kim <iamjoonsoo.kim@lge.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Minchan Kim <minchan@kernel.org>, Nitin Gupta <ngupta@vflare.org>,
Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org,
"David S. Miller" <davem@davemloft.net>,
Stephan Mueller <smueller@chronox.de>
Subject: Re: [PATCH v2 1/8] crypto: support (de)compression API that doesn't require tfm object
Date: Thu, 20 Aug 2015 16:52:17 +0900 [thread overview]
Message-ID: <20150820075217.GA30260@js1304-P5Q-DELUXE> (raw)
In-Reply-To: <20150820064728.GA26840@gondor.apana.org.au>
On Thu, Aug 20, 2015 at 02:47:28PM +0800, Herbert Xu wrote:
> On Thu, Aug 20, 2015 at 03:34:57PM +0900, Joonsoo Kim wrote:
> > Until now, tfm object embeds (de)compression context in it and
> > (de)compression in crypto API requires tfm object to use
> > this context. But, there are some algorithms that doesn't need
> > such context to operate. Therefore, this patch introduce new crypto
> > compression API that call (de)compression function via crypto_alg,
> > instead of tfm object. crypto_alg is required to get appropriate
> > (de)compression function pointer. This can reduce overhead of
> > maintaining multiple tfm if (de)compression doesn't require
> > any context to operate.
> >
> > Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
>
> This isn't going to fly I'm afraid. The main purpose of a tfm
> is not to allocate memory but to track the crypto_alg object
> which could be a hardware device.
>
> So you're not going to get away with not allocating it.
Hmm... I guess there is no problem. crypto_alg object fetched by
crypto_get_comp() introduced in this patch could be hardware device
algorithm which is same one that we can eventually fetch from tfm object.
So, this approach would correctly track the crypto_alg regardless
it is a hardware one or not. If there is some dependency between
algorithm and tfm, it can't support _noctx API. Am I missing
something?
>
> What you can do for these contextless algorithms (and by definition
> every compression algorithm is conxteless) is to allocate a system-
> wide tfm that is used by everybody, or at least by every one within
> your subsystem.
Yes, I thought this way before, but, current way is much simpler so
I try it first. If it is not acceptable, I will implement this
approach.
Thanks.
next prev parent reply other threads:[~2015-08-20 7:46 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-20 6:34 [PATCH v2 0/8] zram: introduce crypto compress noctx API and use it on zram Joonsoo Kim
2015-08-20 6:34 ` [PATCH v2 1/8] crypto: support (de)compression API that doesn't require tfm object Joonsoo Kim
2015-08-20 6:47 ` Herbert Xu
2015-08-20 7:52 ` Joonsoo Kim [this message]
2015-08-20 7:50 ` Herbert Xu
2015-08-20 8:05 ` Joonsoo Kim
2015-08-20 6:34 ` [PATCH v2 2/8] crypto/lzo: support decompress_noctx Joonsoo Kim
2015-08-27 1:54 ` Sergey Senozhatsky
2015-08-20 6:34 ` [PATCH v2 3/8] crypyo/lz4: " Joonsoo Kim
2015-08-27 1:56 ` Sergey Senozhatsky
2015-08-20 6:35 ` [PATCH v2 4/8] crypto/lz4hc: " Joonsoo Kim
2015-08-27 1:57 ` Sergey Senozhatsky
2015-08-20 6:35 ` [PATCH v2 5/8] crypto/842: " Joonsoo Kim
2015-08-20 6:35 ` [PATCH v2 6/8] zram: change zcomp_compress interface Joonsoo Kim
2015-08-27 2:14 ` Sergey Senozhatsky
2015-08-20 6:35 ` [PATCH v2 7/8] zram: use crypto API for compression Joonsoo Kim
2015-08-27 4:01 ` Sergey Senozhatsky
2015-08-20 6:35 ` [PATCH v2 8/8] zram: use decompress_noctx Joonsoo Kim
2015-08-27 4:07 ` Sergey Senozhatsky
2015-08-27 5:47 ` Sergey Senozhatsky
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=20150820075217.GA30260@js1304-P5Q-DELUXE \
--to=iamjoonsoo.kim@lge.com \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=minchan@kernel.org \
--cc=ngupta@vflare.org \
--cc=sergey.senozhatsky.work@gmail.com \
--cc=smueller@chronox.de \
/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