From: Joonsoo Kim <js1304@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Minchan Kim <minchan@kernel.org>, Nitin Gupta <ngupta@vflare.org>,
Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
"David S. Miller" <davem@davemloft.net>,
Stephan Mueller <smueller@chronox.de>,
linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org,
Joonsoo Kim <iamjoonsoo.kim@lge.com>
Subject: [PATCH v4 0/8] zram: introduce contextless compression API and use it on zram
Date: Wed, 14 Oct 2015 16:38:16 +0900 [thread overview]
Message-ID: <1444808304-29320-1-git-send-email-iamjoonsoo.kim@lge.com> (raw)
This patchset introduce contextless compression API and use it on zram in
order to support more compression algorithm without more overhead.
The reason we need to support vairous compression algorithms is that
zram's performance is highly depend on workload and compression algorithm
and architecture. Every compression algorithm has it's own strong point.
For example, zlib is the best for compression ratio, but, it's
(de)compression speed is rather slow. Against my expectation, in my kernel
build test with zram swap, in low-memory condition on x86, zlib shows best
performance than others. In this case, I guess that compression ratio is
the most important factor.
Kernel build elapsed time in QEMU 8 CPUs 448 MB with zram swap
lzo : deflate
188.3 s : 181.9 s
(3% improvement)
Unlike this situation, on ARM, maybe fast (de)compression speed is
the most important because it's computation speed is slower than x86.
Anyway, there is a concern from Sergey to use crypto API in zram. Current
crypto API has a limitation that always require tfm object to (de)compress
something because some of (de)compression function requires scratch buffer
embedded on tfm even if some of (de)compression function doesn't
require it. Due to above reason, using crypto API rather than calling
compression library directly causes more memory footprint and this is
why zram doesn't use crypto API before.
To solve this problem, this patchset introduce contextless compression API.
This new compression API doesn't require user to use tfm one by one.
Tfm is only used for distinguishing compression algorithm and maybe
keeping algorithm parameter so can be used concurrently. Context is now
separate from tfm and user needs to allocate and manage it separately.
With this separation, we can save memory in some cases and get the best
performance.
This patchset solves Sergey's concern perfectly and provides possibility
to use various compression algorithm in zram.
Thanks.
Joonsoo Kim (6):
crypto/compress: introduce contextless compression and remove unused
pcomp
crypto/lzo: support contextless compression API
crypto/lz4: support contextless compressiona API
crypto/deflate: support contextless compression API
zram: use crypto contextless compression API to (de)compress
zram: enable contextless compression alg in zram
Sergey Senozhatsky (2):
zram: make stream find and release functions static
zram: pass zstrm down to decompression path
Documentation/blockdev/zram.txt | 29 ++-
crypto/Kconfig | 18 +-
crypto/Makefile | 3 +-
crypto/ccompress.c | 95 +++++++++
crypto/deflate.c | 96 +++++++++-
crypto/lz4.c | 77 +++++++-
crypto/lzo.c | 81 ++++++--
crypto/pcompress.c | 115 -----------
crypto/zlib.c | 381 -------------------------------------
drivers/block/zram/Kconfig | 13 +-
drivers/block/zram/Makefile | 4 +-
drivers/block/zram/zcomp.c | 104 ++++++----
drivers/block/zram/zcomp.h | 32 ++--
drivers/block/zram/zram_drv.c | 33 +++-
include/crypto/compress.h | 118 ++++--------
include/crypto/internal/compress.h | 28 ---
include/linux/crypto.h | 2 +-
17 files changed, 488 insertions(+), 741 deletions(-)
create mode 100644 crypto/ccompress.c
delete mode 100644 crypto/pcompress.c
delete mode 100644 crypto/zlib.c
delete mode 100644 include/crypto/internal/compress.h
--
1.9.1
next reply other threads:[~2015-10-14 7:38 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-14 7:38 Joonsoo Kim [this message]
2015-10-14 7:38 ` [PATCH v4 1/8] crypto/compress: introduce contextless compression and remove unused pcomp Joonsoo Kim
2015-10-14 7:38 ` [PATCH v4 2/8] crypto/lzo: support contextless compression API Joonsoo Kim
2015-10-14 7:38 ` [PATCH v4 3/8] crypto/lz4: support contextless compressiona API Joonsoo Kim
2015-10-14 8:38 ` kbuild test robot
2015-10-14 7:38 ` [PATCH v4 4/8] crypto/deflate: support contextless compression API Joonsoo Kim
2015-10-14 8:33 ` kbuild test robot
2015-10-14 10:08 ` kbuild test robot
2015-10-14 10:26 ` kbuild test robot
2015-10-14 7:38 ` [PATCH v4 5/8] zram: make stream find and release functions static Joonsoo Kim
2015-10-14 7:38 ` [PATCH v4 6/8] zram: pass zstrm down to decompression path Joonsoo Kim
2015-10-14 7:38 ` [PATCH v4 7/8] zram: use crypto contextless compression API to (de)compress Joonsoo Kim
2015-10-15 0:38 ` Sergey Senozhatsky
2015-10-15 1:07 ` Joonsoo Kim
2015-10-15 1:53 ` Sergey Senozhatsky
2015-10-14 7:38 ` [PATCH v4 8/8] zram: enable contextless compression alg in zram Joonsoo Kim
2015-10-15 0:29 ` Sergey Senozhatsky
2015-10-15 0:45 ` Joonsoo Kim
2015-10-15 2:05 ` Sergey Senozhatsky
2015-10-15 2:48 ` Joonsoo Kim
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=1444808304-29320-1-git-send-email-iamjoonsoo.kim@lge.com \
--to=js1304@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=iamjoonsoo.kim@lge.com \
--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
all inboxes | Powered by JetHome®