Received: by 10.213.65.68 with SMTP id h4csp308996imn; Wed, 21 Mar 2018 19:44:41 -0700 (PDT) X-Google-Smtp-Source: AG47ELu10iyk7EuLJQG6/AjbfngId7OcFYvspwlszKR5eN0c4/4dw/pEkIgOI7y3rmGdQznIHVQ9 X-Received: by 2002:a17:902:bc8b:: with SMTP id bb11-v6mr9093565plb.370.1521686681008; Wed, 21 Mar 2018 19:44:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521686680; cv=none; d=google.com; s=arc-20160816; b=KQi1R4PmT8mThwE6PyfIIeTIMbdmuB0Ip73/2D9hfC6TkHwkaMiZOs8MDJJnXFehAy anzK7uLtVqxCmg1GT4d8+pOGow++yjPHYeNJLXUD/qCjwFBKIE0/Zxb54B8sOhSVdk7A ggr+jo9jKw/RQ5gIoXNozc3vy1hPze17oT4ONjOoXHYgr7A4rd1M0WR4wLVehwlB4oI/ q4CNTP1NhnwtkqCOSyjL0NrALLvOtP7yXNpm45zKEnB6lOZe4lm7ky/MhpGnn0TwJPmw XdldEBmM8pmoQmGywyAlgKzt9TEPlGdqQbtdZ9S+e+gFtqknCReMCOkZSuu6PPoaCZat /Y/w== 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=uRIw2vJpFquHGnKHehmOY8zV5mpn/hc+hmrXV1mJ6jk=; b=ib+Lyk4UusY2mbCytMq2Wq5n6fudsTnDHaynE1X3jsGtexNTpo+JP4YGiErjVRKB6Z BfmQrEj52Y+LozcDNWJjzlY1hM6eV3Y8nyr+vWKUhcOwdIiJWqqTPyK4mAKjn7w2Ckbo jitWDeX6p3X3YhEXPx+PHDxaeGmeUpKl87Yyn3jqvSkexlzyCwS1P6weOti3/olkBjW6 C6agVtffeKXZmb/abqZwoJw/gmaik1F7cfbfLG1gdR4ezgsc/Wjmgmz9NNpecJJIDQk9 ApvNv5rgrMUolc38dM2aOtu/a2sq2Gim0hj68sLL+t+XaON3BCbC6FOTyTB566atfuca HTDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=B+WPhkjW; 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 11-v6si5308736plc.532.2018.03.21.19.44.26; Wed, 21 Mar 2018 19:44:40 -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=B+WPhkjW; 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 S1751997AbeCVCne (ORCPT + 99 others); Wed, 21 Mar 2018 22:43:34 -0400 Received: from mail-pl0-f52.google.com ([209.85.160.52]:43741 "EHLO mail-pl0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751716AbeCVCnb (ORCPT ); Wed, 21 Mar 2018 22:43:31 -0400 Received: by mail-pl0-f52.google.com with SMTP id f23-v6so4407018plr.10; Wed, 21 Mar 2018 19:43: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=uRIw2vJpFquHGnKHehmOY8zV5mpn/hc+hmrXV1mJ6jk=; b=B+WPhkjWV+A2wpGK63yiq54Cd+G9LUqUczOzfbH6Fb1PGw/bmPltOqqkSyu0AGj8kN QJuPanIy9sKZM/cAVSGpHCig3IagSbAbbqj8SzEOONpcaa1XPGb4bCyltIi4SQG5KrHz 7xln//0BsSF72dUcNc/hlYvwJeJ2+3DhWujQCGMnf6CndAkjpPC6bxarzhdcaqCqe2Pl GKLuNwCtLt6Jrc4OKRBGJBYvGIa9+EeKuZwNyiR+uX5UN9KV1ON0qvylRlz6LPg7RwKK seFwfwgBztknRG55LoDWuZ/zRuCyqTD4ACkc+zv899ajm16xv6tWPyzRhV59hTfqM9y+ wxfg== 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=uRIw2vJpFquHGnKHehmOY8zV5mpn/hc+hmrXV1mJ6jk=; b=Rx31TltyW1TdE2mnYKliKH6Cl+iBxpzNFpklXIw4/28I5SmUa0rN79Du/I4Z+FJl3w 2MxSWLLPAPMWfweY7tvs+3qdw1pN6KzZ35Dzs/Lz4aurgi1gh40V1SpwMgfZV+nXubMA NzXgd7iw8QXPppYDPY5ArdqPE2KxKME/pUMuOzrijfXSwM9P9RXuPFvkoOBrpC/cL9rO k0TO+VdBgg9gGS5Dy+lyQ25YyPOca6y+VR5BUTvuIWs2pms/e9LGj35kMsOfcsAsTunB L7t2YGz0ObcSluhkIvR6rBVK2O3bqergBCR1IEUnCGbJFCSSl9v4rUFe2/Swgcgk84ml 2RNQ== X-Gm-Message-State: AElRT7FlH9HyWX5XmeOn7DZ0FEdODNQvfVy+sa3uVus19G4W0XB2MLD9 dRHjIxJ1eN/AW0zEHFwvKck= X-Received: by 2002:a17:902:650e:: with SMTP id b14-v6mr21155240plk.147.1521686610743; Wed, 21 Mar 2018 19:43:30 -0700 (PDT) Received: from localhost ([110.70.57.152]) by smtp.gmail.com with ESMTPSA id t16sm11550187pfm.69.2018.03.21.19.43.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Mar 2018 19:43:29 -0700 (PDT) Date: Thu, 22 Mar 2018 11:43:26 +0900 From: Sergey Senozhatsky To: Nick Terrell Cc: Sergey Senozhatsky , Maninder Singh , "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.m@samsung.com" , "a.sahrawat@samsung.com" , "v.narang@samsung.com" , Yann Collet Subject: Re: [PATCH 0/1] cover-letter/lz4: Implement lz4 with dynamic offset length. Message-ID: <20180322024326.GC3181@jagdpanzerIV> References: <1521607242-3968-1-git-send-email-maninder1.s@samsung.com> <20180321082628.GB2746@jagdpanzerIV> <1663C9A3-7DAC-4A11-894C-C99E07BEDAD2@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1663C9A3-7DAC-4A11-894C-C99E07BEDAD2@fb.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 19:56), Nick Terrell wrote: [..] > This seems like a reasonable extension to the algorithm, and it looks like > LZ4_DYN is about a 5% improvement to compression ratio on your benchmark. > The biggest question I have is if it is worthwhile to maintain a separate > incompatible variant of LZ4 in the kernel without any upstream for a 5% > gain? If we do want to go forward with this, we should perform more > benchmarks. > > I commented in the patch, but because the `dynOffset` variable isn't a > compile time static in LZ4_decompress_generic(), I suspect that the patch > causes a regression in decompression speed for both LZ4 and LZ4_DYN. You'll > need to re-run the benchmarks to first show that LZ4 before the patch > performs the same as LZ4 after the patch. Then re-run the LZ4 vs LZ4_DYN > benchmarks. > > I would also like to see a benchmark in user-space (with the code), so we > can see the performance of LZ4 before and after the patch, as well as LZ4 > vs LZ4_DYN without anything else going on. I expect the extra branches in > the decoding loop to have an impact on speed, and I would like to see how > big the impact is without noise. Yes, I've been thinking about this. There are more branches now ("to dyn or not to dyn") in compression/decompression hot path but we see less instructions and branches in perf output at the end. And my guess is that we have a lot of noise from zram and zsmalloc. The data is XXX bytes shorter with dyn enabled, so we use YYY less moves and ZZZ less branches while we copy the data to zsmalloc and from zsmalloc, and I may be that's the root cause of "performance gain" that we see in zram-fio tests. So may be we need to run benchmarks against lz4, not zram+lz4. > CC-ing Yann Collet, the author of LZ4 Great, thanks. -ss