Received: by 10.213.65.68 with SMTP id h4csp1046693imn; Wed, 21 Mar 2018 00:52:44 -0700 (PDT) X-Google-Smtp-Source: AG47ELu3faji93kO98BEs8nvui8XOfdieHwCodBwi6y93Xkm/sz5k2g3sozAE74Twe1/LnB3bbuP X-Received: by 10.98.20.143 with SMTP id 137mr4547102pfu.78.1521618764149; Wed, 21 Mar 2018 00:52:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521618764; cv=none; d=google.com; s=arc-20160816; b=gRYztGNzPowQwvciSVUNMVdcPG7aUu/bcgRs0edzYw7TrsgdfHK/LXp4PcG3PWXwQV RRezgMhbWmfut2JjI3CcSvPbGVD6dQtN7wga6gWq07eMo+v+rqW1xc8uI9ujU3ed9mmy y6MdHdxJ6uGaWboN99OZjpD0KHQ6aLjRmxM8xUI6jV9n2Y2tNUaBMBOUgJJ8EG23Zs6u wmPr41iWS17dukRMGXCSV3FwIW4aww+YLDpYQCse8LNgywjDoX9q+ZNOWoBU0vJhoyyL uOs/IiP4pizGWwXt+6jyUEEAc+B2ccX6HhKG62hHxsiM9leqgxyOMEE3/bnzKIzfnHQU NWuw== 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=6W3wZrt1aJAcm75F01N70G8wlbMR42yxYt3kX3jJadw=; b=ruDklQtmUChYwiDptWcoufb0TNJFks9oa0PWMuHp/+hpdw9erPoGlb8DAn/JKvyIUu 7cIc/qOCia7Al5J68H40V2pId0EIR+LJj6fT3pb3n5e0akjQr7E2/YK1UPqDnWHOBYnc 6d2qud3sJJoAToGHsKvAiVxqByWyqQdZ4DkD6x/TYvtcgLX9C1ZWT4+9TVl0PkjDSisS hZp9NzQ4syUPgbnG3jBQ8hkoj8/zVrgrhynjpU6PzNh1o9t2sQFZjuoJhR6agmZg2cwn MCvkG9x4D3VN9ASDNxE6V/qsU9xJooWbFQ5yubd2YANPtTPTJXfQ28j0Kl6pmRGW4nXS 6QHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ALeq9VhJ; 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 n1-v6si3269735plp.33.2018.03.21.00.52.30; Wed, 21 Mar 2018 00:52:44 -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=ALeq9VhJ; 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 S1752175AbeCUHuB (ORCPT + 99 others); Wed, 21 Mar 2018 03:50:01 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:35445 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751940AbeCUHty (ORCPT ); Wed, 21 Mar 2018 03:49:54 -0400 Received: by mail-pg0-f66.google.com with SMTP id d1so1663294pgv.2; Wed, 21 Mar 2018 00:49:54 -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=6W3wZrt1aJAcm75F01N70G8wlbMR42yxYt3kX3jJadw=; b=ALeq9VhJ1+0LOQMdCqjQo2eZ9iJX50cnT2QbY+eG3rRyhgCKeoZsmrCJWe0Y/RMgj8 dj/ssC15qDvQgzjte0usjQLcZBTHCwEdFQ6GRMA9sVheq+RJpgbbuaidEEkZLkOKpxIB pxjCqC5ABGj9aDmjCSHwDzpQm3lX/CHZ3eLfbnEEYrwuDCjqURjSsNH9mBbW0FOjWuOE efB22VnsMhCjtvJCj0VM+RtYO2zisfMHDLAlXsPUuRu6C8vvf2e5fMlF0yySycNfHvZj +RX7dQYUx88jJqUC0x06O2orq51QjNGHFsQA3/y05RwdjX6fSYZAMfW3LkDz+Qfk7jw1 00vQ== 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=6W3wZrt1aJAcm75F01N70G8wlbMR42yxYt3kX3jJadw=; b=mHJaXzC0DX+iwFjV3i6LGEpeFZ3GbR4fa6QPWhj4esJZQP8A67AQqXv3MP/hP3clj5 /vH/hzPNlMe3tNejSKwlirJnOwDDbs8XLVstAolaPXCLwTm/iZbfBStoMfCyodiajBMW +jznbsISXLpSxMicZ0nuzIIl/4qEeHSmnmZHoIbTtKgWxsppLuDnf8j05/YZMZuFukeN V8cBe9DLEadVFxvbpIG/RKPTfF4FyGUQZOvb4MqpZi8f8GdGIfAIDGd2DQKyGr6YV00k YjE3+9yE6o0CZlSVKU1rpfTAbPLJO52yVIyQt2gMXf/cme0o33oDl7AqtPHzNkbN7QX4 EGTg== X-Gm-Message-State: AElRT7HT2o7qw8VsNNeYopXKVpYAC4NS/NrAMDMEh8ibamId/YbDvkc6 z0VTWRT06gCoyLlSd0ojrSU= X-Received: by 10.99.67.1 with SMTP id q1mr14300839pga.365.1521618593741; Wed, 21 Mar 2018 00:49:53 -0700 (PDT) Received: from localhost ([175.223.27.28]) by smtp.gmail.com with ESMTPSA id b185sm6019949pgc.2.2018.03.21.00.49.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Mar 2018 00:49:52 -0700 (PDT) Date: Wed, 21 Mar 2018 16:49:48 +0900 From: Sergey Senozhatsky To: Maninder Singh Cc: herbert@gondor.apana.org.au, davem@davemloft.net, minchan@kernel.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, keescook@chromium.org, anton@enomsg.org, ccross@android.com, tony.luck@intel.com, akpm@linux-foundation.org, colin.king@canonical.com, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, pankaj.m@samsung.com, a.sahrawat@samsung.com, v.narang@samsung.com Subject: Re: [PATCH 1/1] lz4: Implement lz4 with dynamic offset length. Message-ID: <20180321074948.GA2746@jagdpanzerIV> References: <1521607242-3968-1-git-send-email-maninder1.s@samsung.com> <1521607242-3968-2-git-send-email-maninder1.s@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1521607242-3968-2-git-send-email-maninder1.s@samsung.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (03/21/18 10:10), Maninder Singh wrote: [..] > +static struct crypto_alg alg_lz4_dyn = { > + .cra_name = "lz4_dyn", > + .cra_flags = CRYPTO_ALG_TYPE_COMPRESS, > + .cra_ctxsize = sizeof(struct lz4_ctx), > + .cra_module = THIS_MODULE, > + .cra_list = LIST_HEAD_INIT(alg_lz4_dyn.cra_list), > + .cra_init = lz4_init, > + .cra_exit = lz4_exit, > + .cra_u = { .compress = { > + .coa_compress = lz4_compress_crypto_dynamic, > + .coa_decompress = lz4_decompress_crypto_dynamic } } > +}; [..] > diff --git a/drivers/block/zram/zcomp.c b/drivers/block/zram/zcomp.c > index 4ed0a78..5bc5aab 100644 > --- a/drivers/block/zram/zcomp.c > +++ b/drivers/block/zram/zcomp.c > @@ -17,11 +17,15 @@ > #include > > #include "zcomp.h" > +#define KB (1 << 10) > > static const char * const backends[] = { > "lzo", > #if IS_ENABLED(CONFIG_CRYPTO_LZ4) > "lz4", > +#if (PAGE_SIZE < (32 * KB)) > + "lz4_dyn", > +#endif This is not the list of supported algorithms. It's the list of recommended algorithms. You can configure zram to use any of available and known to Crypto API algorithms. Including lz4_dyn on PAGE_SIZE > 32K systems. -ss