Received: by 10.192.165.148 with SMTP id m20csp3145315imm; Mon, 23 Apr 2018 01:05:02 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/iSdPAhMIDfqt5KBzF/bdj+dhHKU03oeoxngmJvrN444aVHcLkREH68oXWZLJhu554we7O X-Received: by 10.99.151.17 with SMTP id n17mr15928365pge.171.1524470702576; Mon, 23 Apr 2018 01:05:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524470702; cv=none; d=google.com; s=arc-20160816; b=vCfHV0X+TKBV1yBR1Ns4a5tLWR7821gzzksoWSzo/cVFDN5fkPCacEBvcS7O6pJaAB iu9PgfGDZdObAXP1uTD6W/M7EA7aS5ciOHtoqycEEYIWu+Wp2uhBVHijeIF67YrM6oY0 2ZLeEPYcXB5C05vmjfB8EtKapNf6kEWf6K+dUMHxREKYU/8XFCw0fwOvInLUlPS+mS86 qzJZqZiw2vS+P07gRYNPWTXDY1oZv56UziXB3Ri7ehthZvdNRHbzpJMm/ZRdIGXe9X0B u+svrOySS1p+fnmfPEkZ6YwKg8oErelhCmXOQOoNsd/DWwq+M9OjK9AAMAPap+D+ZRMY LW7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=y49nNGocD+r+DcTTCZTMvcdUyI9TD/dDM6E616o18MQ=; b=gHfBdKEcMAmsZUBxrTOKwXVOgNyx8x93L3s6/1p/AWxT9JQ2gNaI4RTEY0REDmUy1l OfaOnwNTS8/GxGI3LoPupBCsOuaf08X3vYJvNV0FCsQmpkZCqOPh2BO5+ohcMNo8bTTH h6xH02EpFyL9JaJIWoAy8NrhabiBfiTAsWvMT9N0Q0OsVSib45//JRZiN+x3x8cG0Ioy JyspmQt9Byt2c8ZLGivqXxNbe7eAsolbcIXnJUqcXvs8sFLtOxlfXmXSQR6von/mhY/p uGnwihqkS9h4NHMJ02ECIkaWMylqcKhYMm0YiLEgeeyn+JvPqNRDg8VRMIY2s8fWj8Rk OMZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DoZpVs9t; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h10si9097626pfh.278.2018.04.23.01.04.48; Mon, 23 Apr 2018 01:05:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DoZpVs9t; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754188AbeDWIDe (ORCPT + 99 others); Mon, 23 Apr 2018 04:03:34 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:41659 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751356AbeDWIDb (ORCPT ); Mon, 23 Apr 2018 04:03:31 -0400 Received: by mail-pf0-f195.google.com with SMTP id a2so8602388pff.8 for ; Mon, 23 Apr 2018 01:03:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=y49nNGocD+r+DcTTCZTMvcdUyI9TD/dDM6E616o18MQ=; b=DoZpVs9toC2YojBJPDQ63rnRG/giPWfdp3ho0hI0dgrInopPespyBh4SoabB/WWk1v o/ec8b5roIAWcqV8EMHytYHxeBztfIkkrBTdLxQ7TSdx3XSlMtvW4AbKT96yVA36u7fy ZyKn4Qih1bGGrOxjFBqz98J51UCfO6njfe/xpSr7YcCJcDXYlm/1YE3DxWtq9wtqGnzv Z+iVdlZikY7NjNzSLUnl6Qi/QOXCEDzvCldD7Z4c97ewkTIHc3ru3bTRMbwIzOqALOov HE24q7u7SD/lWuzfNLHdz9VjflnVMxkpHKrvjOI3PLKPgD6Z/ah48/NvSMylwDF6kcTD /Ibg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=y49nNGocD+r+DcTTCZTMvcdUyI9TD/dDM6E616o18MQ=; b=CACf2nw+TQ8vPDlQlmMI8hxnv5Bx1TSE46kSy3w2DKgsChLCpwetRv9DtLK0nEMG/Q bvt0vrWf033KjeJVKMjLPqAUvTh8whBiE3vwNZYqdxE3wslxM286pFt/zY5k8mYdHmXs OgH+XcTkK8VjdVy/uZoOygpwFTvVGh9tsi+4CNUpLbYJbyvmrEwg/X6m4kARhQqbvGyf TJJetE1eMEhY5dclelCtlvy+WV4+apxqeP9ykh+r8S7QktyK2zVS8kg/ZHhrGIygkh1j 5bSrNb/J5sbE655PxA614xzX0A1jw6YX6/LrzugpnE6tkl1dR2SdEtxf8BXuklhMuaki KHsA== X-Gm-Message-State: ALQs6tBDNXXifaxzVR3vQ250k8tGM5FLHEZMKrkttFWaBJV255Oju4gA JSvdmbzoQV4Zgl0K7vr7gk8= X-Received: by 10.98.200.152 with SMTP id i24mr19175187pfk.35.1524470611077; Mon, 23 Apr 2018 01:03:31 -0700 (PDT) Received: from localhost (outboundhk.mxmail.xiaomi.com. [207.226.244.125]) by smtp.gmail.com with ESMTPSA id y10sm22571461pgq.30.2018.04.23.01.03.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Apr 2018 01:03:30 -0700 (PDT) Date: Mon, 23 Apr 2018 16:03:28 +0800 From: Geliang Tang To: Kees Cook , Anton Vorontsov , Colin Cross , Tony Luck , Nick Terrell Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] pstore: add zstd compression support Message-ID: <20180423080328.x37v4cvovxoxnqak@OptiPlex> References: <9c9416b2dff19f05fb4c35879aaa83d11ff72c92.1521626182.git.geliangtang@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9c9416b2dff19f05fb4c35879aaa83d11ff72c92.1521626182.git.geliangtang@gmail.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 21, 2018 at 08:29:31PM +0800, Geliang Tang wrote: > This patch added the 6th compression algorithm support for pstore: zstd. > > Signed-off-by: Geliang Tang > --- > Depend on 'crypto: Add zstd support' by Nick Terrell Hi Kees, The patch 'crypto: zstd - Add zstd support' has been applied to linux-next tree, 20180423, already. So we can use zstd in pstore compression now. Please reconsider if my patch can be applied. Thanks. -Geliang > --- > fs/pstore/Kconfig | 17 ++++++++++++++--- > fs/pstore/platform.c | 16 ++++++++++++++++ > 2 files changed, 30 insertions(+), 3 deletions(-) > > diff --git a/fs/pstore/Kconfig b/fs/pstore/Kconfig > index 09c19ef91526..63cf4813559a 100644 > --- a/fs/pstore/Kconfig > +++ b/fs/pstore/Kconfig > @@ -50,12 +50,19 @@ config PSTORE_842_COMPRESS > help > This option enables 842 compression algorithm support. > > +config PSTORE_ZSTD_COMPRESS > + tristate "zstd compression" > + depends on PSTORE > + select CRYPTO_ZSTD > + help > + This option enables zstd compression algorithm support. > + > config PSTORE_COMPRESS > def_bool y > depends on PSTORE > depends on PSTORE_DEFLATE_COMPRESS || PSTORE_LZO_COMPRESS || \ > PSTORE_LZ4_COMPRESS || PSTORE_LZ4HC_COMPRESS || \ > - PSTORE_842_COMPRESS > + PSTORE_842_COMPRESS || PSTORE_ZSTD_COMPRESS > > choice > prompt "Default pstore compression algorithm" > @@ -65,8 +72,8 @@ choice > This change be changed at boot with "pstore.compress=..." on > the kernel command line. > > - Currently, pstore has support for 5 compression algorithms: > - deflate, lzo, lz4, lz4hc and 842. > + Currently, pstore has support for 6 compression algorithms: > + deflate, lzo, lz4, lz4hc, 842 and zstd. > > The default compression algorithm is deflate. > > @@ -85,6 +92,9 @@ choice > config PSTORE_842_COMPRESS_DEFAULT > bool "842" if PSTORE_842_COMPRESS > > + config PSTORE_ZSTD_COMPRESS_DEFAULT > + bool "zstd" if PSTORE_ZSTD_COMPRESS > + > endchoice > > config PSTORE_COMPRESS_DEFAULT > @@ -95,6 +105,7 @@ config PSTORE_COMPRESS_DEFAULT > default "lz4" if PSTORE_LZ4_COMPRESS_DEFAULT > default "lz4hc" if PSTORE_LZ4HC_COMPRESS_DEFAULT > default "842" if PSTORE_842_COMPRESS_DEFAULT > + default "zstd" if PSTORE_ZSTD_COMPRESS_DEFAULT > > config PSTORE_CONSOLE > bool "Log kernel console messages" > diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c > index 1143ef351c58..9df8cdc378f5 100644 > --- a/fs/pstore/platform.c > +++ b/fs/pstore/platform.c > @@ -34,6 +34,9 @@ > #if IS_ENABLED(CONFIG_PSTORE_LZ4_COMPRESS) || IS_ENABLED(CONFIG_PSTORE_LZ4HC_COMPRESS) > #include > #endif > +#if IS_ENABLED(CONFIG_PSTORE_ZSTD_COMPRESS) > +#include > +#endif > #include > #include > #include > @@ -192,6 +195,13 @@ static int zbufsize_842(size_t size) > } > #endif > > +#if IS_ENABLED(CONFIG_PSTORE_ZSTD_COMPRESS) > +static int zbufsize_zstd(size_t size) > +{ > + return ZSTD_compressBound(size); > +} > +#endif > + > static const struct pstore_zbackend *zbackend __ro_after_init; > > static const struct pstore_zbackend zbackends[] = { > @@ -224,6 +234,12 @@ static const struct pstore_zbackend zbackends[] = { > .zbufsize = zbufsize_842, > .name = "842", > }, > +#endif > +#if IS_ENABLED(CONFIG_PSTORE_ZSTD_COMPRESS) > + { > + .zbufsize = zbufsize_zstd, > + .name = "zstd", > + }, > #endif > { } > }; > -- > 2.14.1