From: "Joonsoo Kim" <iamjoonsoo.kim@lge.com>
To: "'Herbert Xu'" <herbert@gondor.apana.org.au>,
"'Li, Weigang'" <weigang.li@intel.com>
Cc: <linux-crypto@vger.kernel.org>,
"'Struk, Tadeusz'" <tadeusz.struk@intel.com>,
"'Sergey Senozhatsky'" <sergey.senozhatsky.work@gmail.com>,
<minchan@kernel.org>
Subject: RE: [PATCH] crypto: add asynchronous compression support
Date: Fri, 20 Nov 2015 15:04:47 +0900 [thread overview]
Message-ID: <003101d12359$5c1f9450$145ebcf0$@lge.com> (raw)
In-Reply-To: <20151119094246.GB27655@gondor.apana.org.au>
Hello, Herbert.
> -----Original Message-----
> From: Herbert Xu [mailto:herbert@gondor.apana.org.au]
> Sent: Thursday, November 19, 2015 6:43 PM
> To: Li, Weigang
> Cc: linux-crypto@vger.kernel.org; Struk, Tadeusz; Joonsoo Kim; Sergey
> Senozhatsky
> Subject: Re: [PATCH] crypto: add asynchronous compression support
>
> On Thu, Nov 19, 2015 at 05:52:41AM +0000, Li, Weigang wrote:
> >
> > After sync-up with Joonsoo Kim, we think it may be not feasible for a
> s/w implementation of the sg-list based asynchronous interface, we propose
> separate interfaces (patches) for acomp & ccomp. The reasons are:
> > 1. to support sg-list in the ccomp (like what shash/ahash did), the
> partial update is required, some algorithms do not support partial update
> (i.e., lzo), that means:
>
> No this is not true. For the ones that don't support partial
> updates you can always linearise the input and then feed it in
> as one chunk. Because the overall interface you're proposing
> does not allow partial updates the underlying implementation
> doesn't need to do it either. Only linearisation is necessary.
Linearization would be enough to use sg-list but it has a problem.
Linearization needs sleepable function such as vmap() and it makes
sync (de)compression in atomic context impossible. Currently, zram
did sync (de)compression in atomic context. It uses map_vm_area() which
isn't sleepable function to linearize two separate pages. This is possible
because zram already knows that maximum number of spread pages is just two
and have allocated vm area in advance. But, if we implement linearization
in general API, we can't be sure of request input size so we need
sleepable function, vmap().
And, this sleep could degrade performance.
> > 2. the format of output buffer (sg-list) will be different, e.g., the
> lzo need contain the "length" info for each block in the output sg-list in
> order to de-compression, while zlib doesn't need, then it is difficult to
> have a single async sg-list i/f.
>
> I have no idea what you mean here. Please explain.
>
> > 3. to compress a sg-list buffer, the lzo also requires an intermediate
> buffer to save the output of a block, and copy it back to the sg-list
> output buffer, it will introduce the complexity and cost, we don't see
> value for sg-list support in a s/w compression.
>
> Such an intermediate buffer would only be needed if the SG list is
> actually non-linear. So I don't see this as an issue.
Intermediate buffer size could vary greatly so it would be allocated and
Freed whenever requested. This could affect performance.
I think that supporting unified API has more loss than gain.
I'm not expert on this area so please let me know what I missed.
Thanks.
next prev parent reply other threads:[~2015-11-20 6:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-16 15:11 [PATCH] crypto: add asynchronous compression support Weigang Li
2015-10-16 15:13 ` Herbert Xu
[not found] ` <929511EA6367314D8E32364A24D45FA612FE85D3@shsmsx102.ccr.corp.intel.com>
[not found] ` <000e01d10a12$9e381660$daa84320$@lge.com>
[not found] ` <20151019084905.GE963@bbox>
[not found] ` <20151021073322.GA31901@swordfish>
[not found] ` <20151021073418.GA14479@gondor.apana.org.au>
2015-10-21 7:59 ` Li, Weigang
2015-10-28 23:13 ` Dan Streetman
2015-11-06 1:55 ` Li, Weigang
2015-11-19 5:52 ` Li, Weigang
2015-11-19 9:42 ` Herbert Xu
2015-11-20 6:04 ` Joonsoo Kim [this message]
2015-11-20 6:19 ` Herbert Xu
2015-11-20 7:25 ` Li, Weigang
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='003101d12359$5c1f9450$145ebcf0$@lge.com' \
--to=iamjoonsoo.kim@lge.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=minchan@kernel.org \
--cc=sergey.senozhatsky.work@gmail.com \
--cc=tadeusz.struk@intel.com \
--cc=weigang.li@intel.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.