Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753257AbdHJTZR (ORCPT ); Thu, 10 Aug 2017 15:25:17 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:41153 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753007AbdHJTZP (ORCPT ); Thu, 10 Aug 2017 15:25:15 -0400 From: Nick Terrell To: "Austin S. Hemmelgarn" , Eric Biggers CC: Herbert Xu , Kernel Team , "squashfs-devel@lists.sourceforge.net" , "linux-btrfs@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-crypto@vger.kernel.org" Subject: Re: [PATCH v5 2/5] lib: Add zstd modules Thread-Topic: [PATCH v5 2/5] lib: Add zstd modules Thread-Index: AQHTEYGVoTkJjkREB0KzOgeDO4eq36J9QseAgAAy2gCAAGJZAIAABoSA//+l3IA= Date: Thu, 10 Aug 2017 19:24:59 +0000 Message-ID: References: <20170810023553.3200875-1-terrelln@fb.com> <20170810023553.3200875-3-terrelln@fb.com> <20170810083017.GA10462@zzz.localdomain> <20170810172342.GA90916@gmail.com> <724f5a31-9ebf-3770-5911-3ee9cb67faca@gmail.com> In-Reply-To: <724f5a31-9ebf-3770-5911-3ee9cb67faca@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [2620:10d:c090:200::4:9568] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR15MB1755;20:23Hicg+k0eaiJMhfZw92FPlCJdVdqrm4CiQWuRy5PhOm0rdDjInbBeO1Odnm5PWvOizYOxN6SjJ0cX0hAQ8iwNMID9ULx48jXBLXiWNhw7RgLyq1cJUFXOw/nQrIFKCjTXJ/APS7Z4HBSRGqtIk0SIUxqMGxkk0ll/EEYTMlYFM= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 46124105-770f-46fe-7bac-08d4e0257e17 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(2017052603031)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:DM5PR15MB1755; x-ms-traffictypediagnostic: DM5PR15MB1755: x-exchange-antispam-report-test: UriScan:(158342451672863)(42068640409301); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(3002001)(6041248)(20161123564025)(20161123560025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:DM5PR15MB1755;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:DM5PR15MB1755; x-forefront-prvs: 03950F25EC x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(189002)(24454002)(199003)(377454003)(377424004)(97736004)(7736002)(6116002)(6506006)(76176999)(54356999)(229853002)(2900100001)(8936002)(6246003)(6486002)(102836003)(39060400002)(77096006)(101416001)(53936002)(6512007)(4326008)(50986999)(82746002)(6436002)(54906002)(305945005)(36756003)(2950100002)(6306002)(99286003)(83716003)(966005)(81156014)(5660300001)(93886004)(2906002)(25786009)(33656002)(53546010)(8676002)(14454004)(189998001)(86362001)(68736007)(81166006)(3660700001)(106356001)(3280700002)(105586002)(478600001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR15MB1755;H:DM5PR15MB1753.namprd15.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" Content-ID: <255F6C75A948DF40A8396B0B1E037E73@namprd15.prod.outlook.com> MIME-Version: 1.0 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Aug 2017 19:24:59.8556 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR15MB1755 X-OriginatorOrg: fb.com X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-08-10_08:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id v7AJPRgn007460 Content-Length: 3402 Lines: 57 On 8/10/17, 10:48 AM, "Austin S. Hemmelgarn" wrote: >On 2017-08-10 13:24, Eric Biggers wrote: >>On Thu, Aug 10, 2017 at 07:32:18AM -0400, Austin S. Hemmelgarn wrote: >>>On 2017-08-10 04:30, Eric Biggers wrote: >>>>On Wed, Aug 09, 2017 at 07:35:53PM -0700, Nick Terrell wrote: >>>>> >>>>> It can compress at speeds approaching lz4, and quality approaching lzma. >>>> >>>> Well, for a very loose definition of "approaching", and certainly not at the >>>> same time. I doubt there's a use case for using the highest compression levels >>>> in kernel mode --- especially the ones using zstd_opt.h. >>> Large data-sets with WORM access patterns and infrequent writes >>> immediately come to mind as a use case for the highest compression >>> level. >>> >>> As a more specific example, the company I work for has a very large >>> amount of documentation, and we keep all old versions. This is all >>> stored on a file server which is currently using BTRFS. Once a >>> document is written, it's almost never rewritten, so write >>> performance only matters for the first write. However, they're read >>> back pretty frequently, so we need good read performance. As of >>> right now, the system is set to use LZO compression by default, and >>> then when a new document is added, the previous version of that >>> document gets re-compressed using zlib compression, which actually >>> results in pretty significant space savings most of the time. I >>> would absolutely love to use zstd compression with this system with >>> the highest compression level, because most people don't care how >>> long it takes to write the file out, but they do care how long it >>> takes to read a file (even if it's an older version). >> >> This may be a reasonable use case, but note this cannot just be the regular >> "zstd" compression setting, since filesystem compression by default must provide >> reasonable performance for many different access patterns. See the patch in >> this series which actually adds zstd compression to btrfs; it only uses level 1. >> I do not see a patch which adds a higher compression mode. It would need to be >> a special setting like "zstdhc" that users could opt-in to on specific >> directories. It also would need to be compared to simply compressing in >> userspace. In many cases compressing in userspace is probably the better >> solution for the use case in question because it works on any filesystem, allows >> using any compression algorithm, and if random access is not needed it is >> possible to compress each file as a single stream (like a .xz file), which >> produces a much better compression ratio than the block-by-block compression >> that filesystems have to use. > There has been discussion as well as (I think) initial patches merged > for support of specifying the compression level for algorithms which > support multiple compression levels in BTRFS. I was actually under the > impression that we had decided to use level 3 as the default for zstd, > but that apparently isn't the case, and with the benchmark issues, it > may not be once proper benchmarks are run. There are some initial patches to add compression levels to BtrFS [1]. Once it's ready, we can add compression levels to zstd. The default compression level in the current patch is 3. [1] https://lkml.kernel.org/r/20170724172939.24527-1-dsterba@suse.com