Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp607084ybi; Fri, 7 Jun 2019 13:33:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqzB6c3eNneO+JSASD/cN1z+kTCXaRb/4KfUyLsozs/vNuYADX0SBKem/VXKsh19pzSFpvs5 X-Received: by 2002:a17:902:3103:: with SMTP id w3mr57094795plb.329.1559939611201; Fri, 07 Jun 2019 13:33:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559939611; cv=none; d=google.com; s=arc-20160816; b=1AAm4meBuHfaqRp0IDXcmtWhy7whqC+U7+OCd6oDzp4tDcj1Ktz6C6s5PFiQUe/sWR sDCiIiyYi+/kHsjwFmGO8XDhIA+pn2VxJfuFt5ypYnNrNyZw3znakKN8aCo/wBzpiiz+ o9TJVvS0+a9Gv8H4xuNFh5RfSqA9h/1Fq5HWb8yurRG0po8gSSVAzsBtbW12n/Z2dArS Ks1W0flUHdMe3xTw1vNhvcfRLLOM47XoiBdVb8QbcUvUvjdnVAoAO7qSSJGjeN1Q89YR s0f9HVNYkDNJC71fMxR7t5GMdioQE0yLhDvw36X9r/Tpx8NXTYm8ArOXKqSystTwKFNG AiEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=hSzQpwAiM+NRy/HIwuQOaL4l6Fd+62I0ixlRApmIXxg=; b=PpHZlvB1gY9yuhE8aRxgfunYXJ4L9cCujKWeXfOR2SPnjKYKBhBBZgz9ABU9r2dLNu Fnp667RGIBHTiUaA5G/KXJsiVFBpw1XvTlYyUHw/dJcLpQFQbo81FPBgV5L9dMJDqe3a gzxFes4SZiwG8CKz9gRAVU73MGR6Ui7Z3iaUMpDp5qwoeUT9hRwIQhTl0PVQaI7Mb+qb LK06HmqB2M4+p4/NySZB/PiINEhf1RQuct7hNnv/QHgU3acrc3e4vUzG0LWEoZ3p1FzD UApikIfVp72jEe7+Zz7sGscoMKLFUHeAEjajEgJeQx/yy+YIBJlJ/jFOwegesUWa6rNC +u6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="QuSDK9d/"; 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 g10si3022931pgh.472.2019.06.07.13.33.14; Fri, 07 Jun 2019 13:33:31 -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="QuSDK9d/"; 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 S1729891AbfFGU1S (ORCPT + 99 others); Fri, 7 Jun 2019 16:27:18 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:33217 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729118AbfFGU1S (ORCPT ); Fri, 7 Jun 2019 16:27:18 -0400 Received: by mail-pf1-f196.google.com with SMTP id x15so1824059pfq.0 for ; Fri, 07 Jun 2019 13:27:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=hSzQpwAiM+NRy/HIwuQOaL4l6Fd+62I0ixlRApmIXxg=; b=QuSDK9d/92EWHndE25zvgWp5ImGBwWWZLLMC1zNMpDzzq2SJoPio9YmJtPPXQ93DSw RNfFLtMfA2defydY7h8wb4mOvvVP8Dz01WJ6rpmYK3WAn8BkwSLNBhsfDihBBsrQPtmR Sh0rTT/7nJxNJRDkkDq4tJ/fV6CBkRMG8nEfQwuMySYIsF9ILZAJfb8ooiPyhUxcEHPk 4J9JdkPre9sn5hA17a8qKwUvKjv60eSOln5Gbe4vRsfPXpa9BCgzg1kok79jRa8krR3d +u/d2gO28o6A4jsFWc9NrbwkjScwmcoZrTXNtsqI7GG1Cd0zQL9Ld0GfVfJHqc//fZai cEbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=hSzQpwAiM+NRy/HIwuQOaL4l6Fd+62I0ixlRApmIXxg=; b=DM+Xz7PGxouJ2pxOJCUhDd109nTJnbEYjrozyv8hWlLbv2bDyHns+ydtEKZTeBmW0B uIZc7yzIufe64TQDckHPs7bHdG3tyvSa8PUxxcSX2XgLOGcNDyMpJ4fwjxSNQo8wyH/p sFKm0tPRebrtEriAISVlW3Fe+BYpCCgo6gFV9zzt2HXEp3J/e+xUhSt7mTDbA0tiPimq SEqsVuMQOxbzL8i55yjb6hKrSYvJCDQR/I/Un+av7Hd2wPijj+MPGeHtaqaa456YGI4X U++ZBr2stfRTq7rR+dMizzp/hiwy1gtKptNuaJoFaBtPd5swArnQgH0pjn4mJexIFrzO 0WVQ== X-Gm-Message-State: APjAAAUC2Vt7/CqF2rV8Y46Qobg8q4QDRmic+7m+ofH1FqGImNQ6YPnj kdwpqftSIGnglrmwB9baGOO1N5yjvFmTNB/xxYEnUlW1s6M= X-Received: by 2002:aa7:82d6:: with SMTP id f22mr62257168pfn.151.1559939237240; Fri, 07 Jun 2019 13:27:17 -0700 (PDT) MIME-Version: 1.0 References: <20190515210202.21169-1-richard@nod.at> <1644731533.84685.1559938164477.JavaMail.zimbra@nod.at> In-Reply-To: <1644731533.84685.1559938164477.JavaMail.zimbra@nod.at> From: Emil Lenngren Date: Fri, 7 Jun 2019 22:27:09 +0200 Message-ID: Subject: Re: [PATCH] ubifs: Add support for zstd compression. To: Richard Weinberger Cc: linux-mtd , Sebastian Andrzej Siewior , linux-kernel , Michele Dionisio Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Den fre 7 juni 2019 kl 22:09 skrev Richard Weinberger : > > Emil, > > ----- Urspr=C3=BCngliche Mail ----- > > In fs/ubifs/sb.c we have > > > > static int get_default_compressor(struct ubifs_info *c) > > { > > if (ubifs_compr_present(c, UBIFS_COMPR_LZO)) > > return UBIFS_COMPR_LZO; > > > > if (ubifs_compr_present(c, UBIFS_COMPR_ZLIB)) > > return UBIFS_COMPR_ZLIB; > > > > return UBIFS_COMPR_NONE; > > } > > > > Maybe add an entry for zstd here as well? > > Where would you add it? If we add it after UBIFS_COMPR_ZLIB, > it will effectively never get selected, unless someone builds a kernel > without lzo and zlib but zstd. > If we add it before UBIFS_COMPR_ZLIB, it will be used always and users > end up with unreadable files if they reboot to an older kernel. > Please note that we didn't raise the UBIFS format version for zstd. > > So I'm not sure what is the best choice for the default filesystem. My idea was at the end, i.e. it will only be used when LZO and ZLIB are not selected to be included for UBIFS, for example when someone compiles a minimal kernel who knows exactly which compression algorithms will be used on that system. I guess that's the same reason why zlib exists at all and is placed after lzo. But of course the other positions also have their pros. If we perform more benchmarks speed/size and conclude that zstd outperforms zlib for all aspects, then maybe placing it between lzo and zlib could be an option, but as you say we should avoid breaking compatibility with older systems. I did a single test today and compared lzo and zstd and on that test lzo had faster decompression speed but resulted in larger space. I'll do more tests later. /Emil