Received: by 10.192.165.156 with SMTP id m28csp1041715imm; Mon, 16 Apr 2018 13:03:01 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/p1ZXWX/WNYIcz2MFaGB++xY5s5w0M58Z/NvlddNVMlY79GE7Yc1Qi0JKkHILZCMgo9l5d X-Received: by 10.101.81.11 with SMTP id f11mr10461739pgq.137.1523908981501; Mon, 16 Apr 2018 13:03:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523908981; cv=none; d=google.com; s=arc-20160816; b=sZhEyPbMoBmGhKTksmqz4JYBvgI/QKBLBHv3Zif6qIk2JzhZtSGMHQo0A1mjPhn0KI i9x3kkY/ewRRcEDRmpFgyR799askZUQI2fiu164+hahm4o7dLE3kYDe7Z6ryD1N0aD9y sXGKLJG/bhA3n4dlG/9YFFR/qH2a3Cwwe6G8uC4ocHQGkBVdBx8FXD4AqQmkxOtx6kKV A+LBH35p9IOnFMO7ppnq7wGtF2sHIVOOok3AODFSP0BLY/rN3aZHvCXzSEdMhf9CF95Q BGyNNsCaJtCNe+SDkCgZefYVqo9dbugYtT+IRgND6lP7FLoV7SDF3rZe+jAh+/CDxxGH 2D5w== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=MvE2hbV7v4G8gCyCK+nxR+vIbPLb4pcHkJf8TFdbZSw=; b=xeww7+kB7gnl+aT++plkrUy8+aDwzSt6dKsPO0Mq84pZpsG98wcBXza+Ha0846rngY ClRzY9yZaK9M9LQgv+lP4mmJvHCDV8wklAElb68OzvBX7gQ/mAMQhx3slcWBjivG6YGP qfE64pWB0CAV/OEP+f0fAvFTVWFVOpvVKl9/cVqTdD34FhhKlEbceDmxAckfXf9KKbJQ l5IoEXSfx29r5uAE/on1XOIhoHm2UXekXUEWgu571/tPcIGUeSrSkY/WfZD65gQSaTB0 rZG3pogILJJTrk8YA3lzC6cUm0kgT7GikgH24WsagOXl/TShyrbdPNA1SBjETpS7ANIN uiwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hqk4JhjR; 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 t7si6205445pgs.654.2018.04.16.13.02.46; Mon, 16 Apr 2018 13:03:01 -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=hqk4JhjR; 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 S1753540AbeDPUBX (ORCPT + 99 others); Mon, 16 Apr 2018 16:01:23 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:40295 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753323AbeDPUBV (ORCPT ); Mon, 16 Apr 2018 16:01:21 -0400 Received: by mail-pf0-f193.google.com with SMTP id y66so11037591pfi.7; Mon, 16 Apr 2018 13:01:21 -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:content-transfer-encoding:in-reply-to :user-agent; bh=MvE2hbV7v4G8gCyCK+nxR+vIbPLb4pcHkJf8TFdbZSw=; b=hqk4JhjRYC3lrc0n8FvNveywd06s9oUFYO8rK7d/fE8nww0TPEUcPExo94VlFs7K78 +Qm+F8lVF9NqR04frb1GNcghtsI3mxmEJglxKgwSnwgc1TxWfNui2THbHUNyoF0nryIs Jp6Q0VWDjAp63IZxOuprc5SQNj1QfX8OhNbTWrjIZ+mqIjbYBWFgInq/h7I8PysselP+ orKBl04x0MCL36TKGp34exUjauft1mHN9uUeYcOG0GQlMrtTTJ7Y+nVUHH5mPyhZR1Py nN3idLPvZoKiY0Ldqb3L+PmLhDQDYVIloKicXhEQIjTD+Np8OJXioslIzix/Nu3U7eAa VTXA== 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:content-transfer-encoding :in-reply-to:user-agent; bh=MvE2hbV7v4G8gCyCK+nxR+vIbPLb4pcHkJf8TFdbZSw=; b=O6L3HrxhyQIaOZrlDFQWU8b58vC/hneTfAOrccDmo+/+UatiZJ/3CV2EkcV1H1m0zw q0MLKW5XI6Jvp6m9W9IEqcnGPqA1By0POtezE9q+jFr4OoKDwAY+YYs+tGlOxtyTmveh 5hJTC0t+/uag8BqcmDuQZTsaK+MW8aHMNAg9Mv1Vah8gt2660ZokU0bT399V5TOBoWjc 2mjnPCGmQhXsXjCHgugYH7OX+3TwJZggeMS6XgrX2WFpD58W+txU+cPuqvyUlyxMwQxH 7exUVx6yJzvE4mjwpSX/GEliKXnMpnGSAubaw0yqlewITEV/KtsGfi/gyMFFiFhE+MPj JMYg== X-Gm-Message-State: ALQs6tDyCCpKcvPHgGHwizVxfuEsSfa+0io3Ar7GlMJJQDl9xAP5FLMq ezHCM03pkJJK743EtUyCX3M= X-Received: by 10.99.127.3 with SMTP id a3mr3895599pgd.267.1523908880772; Mon, 16 Apr 2018 13:01:20 -0700 (PDT) Received: from gmail.com ([2620:15c:17:3:dc28:5c82:b905:e8a8]) by smtp.gmail.com with ESMTPSA id t1sm26013591pgs.47.2018.04.16.13.01.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Apr 2018 13:01:20 -0700 (PDT) Date: Mon, 16 Apr 2018 13:01:18 -0700 From: Eric Biggers To: Yann Collet Cc: "maninder1.s@samsung.com" , Vaneet Narang , Nick Terrell , Sergey Senozhatsky , "herbert@gondor.apana.org.au" , "davem@davemloft.net" , "minchan@kernel.org" , "ngupta@vflare.org" , Kees Cook , "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 , "gregkh@linuxfoundation.org" Subject: Re: [PATCH 0/1] cover-letter/lz4: Implement lz4 with dynamic offset length. Message-ID: <20180416200118.GA10051@gmail.com> References: <20180329102613epcms5p6ffaa80d12115ded8f3c9ef01dd009744@epcms5p6> <20180329102046epcms5p8ecc9532b03bab4f47cbdbb2507171b86@epcms5p8> <20180323134319epcms5p62e6021aa33c941c46ecdb8b5364b614c@epcms5p6> <1663C9A3-7DAC-4A11-894C-C99E07BEDAD2@fb.com> <1521607242-3968-1-git-send-email-maninder1.s@samsung.com> <20180321082628.GB2746@jagdpanzerIV> <20180416102138epcms5p429e04b68b94dcf80cd84f7008467ed68@epcms5p4> <74EB06AE-E1CA-4B06-9935-596DCFAC951C@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <74EB06AE-E1CA-4B06-9935-596DCFAC951C@fb.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 16, 2018 at 07:34:29PM +0000, Yann Collet wrote: > Hi Singh > > I don't have any strong opinion on this topic. > > You made your case clear: > your variant trades a little bit of speed for a little bit more compression ratio. > In the context of zram, it makes sense, and I would expect it to work, as advertised in your benchmark results. > (disclaimer: I haven't reproduced these results, just, they look reasonable to me, I have no reason to doubt them). > > So, the issue is less about performance, than about code complexity. > > As mentioned, this is an incompatible variant. > So, it requires its own entry point, and preferably its own code path > (even if it's heavily duplicated, > mixing it with regular lz4 source code, as proposed in the patch, will be bad for maintenance, > and can negatively impact regular lz4 usage, outside of zram). > > So that's basically the "cost" of adding this option. > > Is it worth it? > Well, this is completely outside of my responsibility area, so I really can't tell. > You'll have to convince people in charge that the gains are worth their complexity, > since _they_ will inherit the duty to keep the system working through its future evolutions. > At a minimum, you are targeting maintainers of zram and the crypto interface. > For this topic, they are the right people to talk to. > > > On 4/16/18, 04:09, "Maninder Singh" wrote: > > > Hello Nick/ Yann, > > Any inputs regarding LZ4 dyn results & lz4 dyn approach. > > >Hello Nick/Sergey, > > > >Any suggestion or comments, so that we can change code and resend the patch? > > > >> Hi Nick / Sergey, > >> > >> > >> We have compared LZ4 Dyn with Original LZ4 using some samples of realtime application data(4Kb) > >> compressed/decompressed by ZRAM. For comparison we have used lzbench (https://github.com/inikep/lzbench) > >> we have implemented dedicated LZ4 Dyn API & kept last literal length as 6 to avoid overhead > >> of checks. It seems in average case there is a saving of 3~4% in compression ratio with almost same compression > >> speed and minor loss in decompression speed (~50MB/s) when compared with LZ4. > >> > >> Comparison of Lz4 Dyn with LZO1x is also done as LZO1x is default compressor of ZRAM. > >> Unfortunately the track record of maintaining compression code in the Linux kernel is not great. zlib for example was forked from v1.2.3, which was released in 2005, and hasn't been updated since besides some random drive-by patches which have made it diverge even further from upstream. There have even been bugs assigned CVE numbers in upstream zlib, and I don't think anyone has looked at whether the Linux kernel version has those bugs or not. The story with LZ4 is a bit better as someone updated it to v1.7.3 last year. But, it took a lot of rounds of review in which I had to point out some subtle regressions like the hash table size being accidentally changed, and things not being inlined that should be. And of course now that version is outdated already. We also have LZO and Zstandard in the kernel to maintain too, as well as XZ decompression. And very problematically, *none* of these compression algorithms have a maintainer listed in the MAINTAINERS file. So in my opinion, as a prerequisite for this change, someone would need to volunteer to actually maintain LZ4 in the kernel. Thanks, Eric