Received: by 10.213.65.68 with SMTP id h4csp3460451imn; Tue, 3 Apr 2018 05:28:23 -0700 (PDT) X-Google-Smtp-Source: AIpwx48qhNK2kLfUZVjKY0dsG8QL8Kkpq5Z/BJFdIH8iKBtmd+k6znXE3gu56pphqSTLh93ZcPD2 X-Received: by 10.101.73.2 with SMTP id p2mr8714982pgs.397.1522758503668; Tue, 03 Apr 2018 05:28:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522758503; cv=none; d=google.com; s=arc-20160816; b=DofS/F9SSKA0+VZdYC4erYJq/nIGJVRoZUCsrpkBcCp/f7EEi3JLW3ts1ev8jVPNqi slK5JyaEm/v6qe8pgx6836OxLZtFu5mQpKk8Qz4ysCibNBHfXuzV34kW8Dy58shTudmq oQS7IAqeQR7uBF9WLHJxmcDORrsDvN4TLpbm+A+dyt61bKh/F90p9bayBS28laMu8sUG 1HnL6BGdNID+lLMyuUBLALPGYF1k9eKQRezrK70B/vLyw5CdrGMSBnmSDo3GbpWM5z/x Mq5dGDj3mpeY79AEgQ+wB6YX5CCPw2VK6cRLLm1mMX+Noej2v4DMCIRogjWZx24k7zIP e2tA== 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=EsYDUMykYEvzZeO17Ite2aPtrQSSD6QtbGsWTSHG+X8=; b=s+lqBVPfkNd1gbGYbdvd8QTCEc94NyptVuIBH/FCGR4PdT28jsn5lWCXiwt5De1oyz ZRxsa9JzwmfFTnVAXwe6X0iMZV6RhNTpq07THigKGc8XmlSZLuy9qujcNqcWzBzAJ/mz R2Getce0nV9939TkeRRsiC3eHh8QORpX6+B8Or0y+RAKd9x9qz/8HT27vfi1GFmY3ESR Lte14vQT31NAKiVMPAWKV61ZVxlewdULx8LZk29yo7+c9ZffcGfvnTFR9KpgIeRMjNZK DVED4QDij98O73sRLjuYWpaGGszcj3m00oMiVUOkmGP6ASU4cucg/QyrYtvrFSnmOA6k G3xQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RuVNtU8g; 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 y136si2143551pfg.81.2018.04.03.05.28.09; Tue, 03 Apr 2018 05:28:23 -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=RuVNtU8g; 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 S1755490AbeDCM0s (ORCPT + 99 others); Tue, 3 Apr 2018 08:26:48 -0400 Received: from mail-pl0-f48.google.com ([209.85.160.48]:37932 "EHLO mail-pl0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755300AbeDCM0r (ORCPT ); Tue, 3 Apr 2018 08:26:47 -0400 Received: by mail-pl0-f48.google.com with SMTP id k6-v6so3424207pls.5; Tue, 03 Apr 2018 05:26:46 -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=EsYDUMykYEvzZeO17Ite2aPtrQSSD6QtbGsWTSHG+X8=; b=RuVNtU8gkJ6HbLvtz/sb2Hjyilkexp8a+oOHlgcfFkjyZqnOc9ckaMe3qeUx2NMEf9 rGxsHmozqxaws9NuHL/88t3Dzb+8s2rFzfSYexWhaBMZzLZ+q2TKiKF+uFqc6wN7gN3P TTZwN2fPMcGoJj+OSdM+T9MjDXaOaXa3+je5xKcZr7/s15+jpQtKIR3hR0wnnaABtpLT TJAYSo8ROUdNV56tvf9wHbiU2ShnKAupCOyFSdITfZEPt9yEu3CXYRt8mgNJE4ZIyVqu I3mUcijCPxHklEug7EYlI3ZVtjUKa0ONTzQeDHQVDibHVNbw6ETuzAwa7HbLGpDvkLxx g1Pg== 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=EsYDUMykYEvzZeO17Ite2aPtrQSSD6QtbGsWTSHG+X8=; b=bf3oCKPcxnNmGyxO/X5aKIXX92RUMutKFC3EBDqFFOfLwpccxvMJtEmoNKZClnFyM1 nOQLeR3iIgngADIFA2vXM1KBUdNafgYq3eOm/TK4k6iKb11a02POa9Cw+P1WaDv/lT3b PHdaZfg9h0LoX78xwvmGimh8l4DjoRCzi4UpMyD/jmKBndhYqP2u9NnJnq/BcZx9+wXx u7u4OEz4ABI171MMbq66bc6mgpVmy4oLRklH75/3WPdrA3xMnaiLGoYFBrsv+5JrrRE2 eW+HuiZQNAOpmpOv+lc+q5vOqbXZVVC/X+PaIhXMQOXO5MNrw1vp9h1mh21xpLe2jdMq 8Uug== X-Gm-Message-State: AElRT7EJIrKWkmEdQGAGUqb1ysC0ljw5VixNkjB5XjyPt+UFdBZ5AG2R 24XLtVXx9Il8cff8J0RQ9+8= X-Received: by 2002:a17:902:7482:: with SMTP id h2-v6mr14126615pll.264.1522758406582; Tue, 03 Apr 2018 05:26:46 -0700 (PDT) Received: from localhost ([175.223.48.43]) by smtp.gmail.com with ESMTPSA id e21sm4927782pfi.68.2018.04.03.05.26.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Apr 2018 05:26:45 -0700 (PDT) Date: Tue, 3 Apr 2018 21:26:42 +0900 From: Sergey Senozhatsky To: Maninder Singh Cc: "sergey.senozhatsky.work@gmail.com" , "herbert@gondor.apana.org.au" , "davem@davemloft.net" , "minchan@kernel.org" , "ngupta@vflare.org" , "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 MISHRA , AMIT SAHRAWAT , Vaneet Narang Subject: Re: [PATCH 1/1] lz4: Implement lz4 with dynamic offset length. Message-ID: <20180403122642.GA26934@jagdpanzerIV> References: <20180321074948.GA2746@jagdpanzerIV> <1521607242-3968-1-git-send-email-maninder1.s@samsung.com> <1521607242-3968-2-git-send-email-maninder1.s@samsung.com> <20180402055152epcms5p546fdb62381b769ed0c719f3bedcee3b8@epcms5p5> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180402055152epcms5p546fdb62381b769ed0c719f3bedcee3b8@epcms5p5> 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 (04/02/18 11:21), Maninder Singh wrote: [..] > >> 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. > > > Yes, we want to integrate new compression(lz4_dyn) for ZRAM > only if PAGE_SIZE is less than 32KB to get maximum benefit. > so we added lz4_dyn to available list of ZRAM compression alhorithms. Which is not what I was talking about. You shrink a 2 bytes offset down to a 1 byte offset, thus you enforce that 'page should be less than 32KB', which I'm sure will be confusing. And you rely on lz4_dyn users to do the right thing - namely, to use that 'nice' `#if (PAGE_SIZE < (32 * KB))'. Apart from that, lz4_dyn supports only data in up to page_size chunks. Suppose my system has page_size of less than 32K, so I legitimately can enable lz4_dyn, but suppose that I will use it somewhere where I don't work with page_size-d chunks. Will I able to just do tfm->compress(src, sz) on random buffers? The whole thing looks to be quite fragile. -ss