public inbox for linux-crypto@vger.kernel.org
 help / color / mirror / Atom feed
From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: dsterba@suse.cz, Giovanni Cabiddu <giovanni.cabiddu@intel.com>,
	Yang Shen <shenyang39@huawei.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	ardb@kernel.org, kees@kernel.org, linux-kernel@vger.kernel.org,
	enlin.mu@unisoc.com, ebiggers@google.com, gpiccoli@igalia.com,
	willy@infradead.org, yunlong.xing@unisoc.com,
	yuxiaozhang@google.com, qat-linux@intel.com,
	Linux Crypto Mailing List <linux-crypto@vger.kernel.org>,
	Zhou Wang <wangzhou1@hisilicon.com>,
	Weigang Li <weigang.li@intel.com>, Chris Mason <clm@meta.com>,
	Brian Will <brian.will@intel.com>,
	linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 2/4] crypto: qat - Remove zlib-deflate
Date: Wed, 6 Sep 2023 10:51:10 +0800	[thread overview]
Message-ID: <bc05ff13-97a0-f101-6aad-d9d217648e20@linux.alibaba.com> (raw)
In-Reply-To: <20230905162302.GD14420@twin.jikos.cz>



On 2023/9/6 00:23, David Sterba wrote:
> On Tue, Sep 05, 2023 at 02:15:44PM +0100, Giovanni Cabiddu wrote:
>> Hi Herbert,
>>
>> On Wed, Aug 30, 2023 at 06:08:47PM +0800, Herbert Xu wrote:
>>> Remove the implementation of zlib-deflate because it is completely
>>> unused in the kernel.
>> We are working at a new revision of [1] which enables BTRFS to use acomp
>> for offloading zlib-deflate. We see that there is value in using QAT for
>> such use case in terms of throughput / CPU utilization / compression ratio
>> compared to software.
>> Zlib-deflate is preferred to deflate since BTRFS already uses that
>> format.
>>
>> We expect to send this patch for 6.7.
>> Can we keep zlib-deflate in the kernel?
>>
>> Thanks,
>>
>> [1] https://patchwork.kernel.org/project/linux-btrfs/patch/1467083180-111750-1-git-send-email-weigang.li@intel.com/
> 
> The patch is from 2016 and zlib though still supported has been
> superseded by zstd that is from 2017. It would be good to see numbers
> comparing zlib (cpu), zlib (qat) against relevant zstd levels. The
> offloading might be an improvement and worth adding the support
> otherwise I don't see much reason to add it unless there are users.
> 
> I can see there's QAT support for zstd too,
> https://github.com/intel/QAT-ZSTD-Plugin, can't find one for lzo but in
> case ther's QAT for all 3 algorithms used by btrfs I wouldn't mind
> keeping the QAT support for zlib for parity.

Just my personal side note: from my own point of view, QAT actually only
has DEFLATE and LZ4 format hardware end-to-end (de)compression support [1]
(IAA actually has DEFLATE-family format only [2]).

They partially support compressing Zstd format with their internal
hardware lz4s + postprocessing pipeline (mostly a LZ77 matchfinder) by
using hardware (with hw_buffer_sz less than 128KiB. [3][4]) and Zstd
hardware decompression is currently not supported since there is no
such hardware format support.

I'm not saying new Zstd algorithm is not amazing.  Yet from the hardware
perspective, I guess that due to gzip, the original zip, png, pdf, docx,
https, even pppoe all based on DEFLATE (you could see a lot other OSes
support DEFLATE-family format), so it's reasonble to resolve such
de-facto standard with limited hardware first to boost up data center
use cases.  If they have abundant hardware chip room, I guess they will
consider Zstd as well.

As for zlib container format, I don't see zlib Adler-32 checksum is
useful since almost all hardware accelerator supports raw DEFLATE but
Adler-32 checksum is uncommon.  If we consider better integrating
support, we should consider a more common hash (instead Adler-32
checksum) of or by using merkle tree to build the trust chain.

Actually we're working on EROFS raw deflate to enable IAA accelerator
support so we also hope IAA patchset could be landed upstream [5] so
I could upstream my work then.  Therefore, I hope "hisilicon ZIP
driver" could support raw deflate too (after a quick search, their
decompression spend is 1530 MB/s compared with the original zlib
219 MB/s on their platform [6])

[1] https://github.com/intel/QATzip
[2] https://cdrdv2.intel.com/v1/dl/getContent/721858
[3] https://github.com/facebook/zstd/issues/455#issuecomment-1397204587
[4] https://github.com/intel/QATzip/blob/master/utils/qzstd.c#L211
[5] https://lore.kernel.org/r/20230807203726.1682123-1-tom.zanussi@linux.intel.com
[6] https://compare-intel-kunpeng.readthedocs.io/zh_CN/latest/accelerator.html

Thanks,
Gao Xiang

  reply	other threads:[~2023-09-06  2:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAHk-=wgaY2+_KyqVpRS+MrO6Y7bXQp69odTu7JT3XSpdUsgS=g@mail.gmail.com>
     [not found] ` <ZO8HcBirOZnX9iRs@gondor.apana.org.au>
2023-08-30 10:04   ` [PATCH 0/4] crypto: Remove zlib-deflate Herbert Xu
2023-08-30 10:08     ` [PATCH 1/4] crypto: hisilicon/zip - Remove driver Herbert Xu
2023-08-31  2:21       ` Yang Shen
2023-08-31  5:42         ` Herbert Xu
2023-08-31  9:39           ` Yang Shen
2023-08-31 11:57             ` Herbert Xu
2023-08-30 10:08     ` [PATCH 2/4] crypto: qat - Remove zlib-deflate Herbert Xu
2023-09-05 13:15       ` Giovanni Cabiddu
2023-09-05 16:23         ` David Sterba
2023-09-06  2:51           ` Gao Xiang [this message]
2023-08-30 10:08     ` [PATCH 3/4] crypto: deflate " Herbert Xu
2023-08-30 10:08     ` [PATCH 4/4] crypto: testmgr " Herbert Xu
2023-08-30 12:52     ` [PATCH 0/4] crypto: " Ard Biesheuvel
2023-08-30 15:29     ` Linus Torvalds

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=bc05ff13-97a0-f101-6aad-d9d217648e20@linux.alibaba.com \
    --to=hsiangkao@linux.alibaba.com \
    --cc=ardb@kernel.org \
    --cc=brian.will@intel.com \
    --cc=clm@meta.com \
    --cc=dsterba@suse.cz \
    --cc=ebiggers@google.com \
    --cc=enlin.mu@unisoc.com \
    --cc=giovanni.cabiddu@intel.com \
    --cc=gpiccoli@igalia.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=kees@kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=qat-linux@intel.com \
    --cc=shenyang39@huawei.com \
    --cc=torvalds@linux-foundation.org \
    --cc=wangzhou1@hisilicon.com \
    --cc=weigang.li@intel.com \
    --cc=willy@infradead.org \
    --cc=yunlong.xing@unisoc.com \
    --cc=yuxiaozhang@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox