Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3690235pxb; Wed, 13 Oct 2021 10:54:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEv9ylE7Iuvr7dF637zfrFvwNxS2ihM/l9pAYdy190e0AO5q5teuGUryGFuJO1KRffDvRi X-Received: by 2002:a63:7402:: with SMTP id p2mr458592pgc.472.1634147686389; Wed, 13 Oct 2021 10:54:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634147686; cv=none; d=google.com; s=arc-20160816; b=pDUDMgSeW94n0/M3sJ/RkBolnko7OuEdisvjXSdu5a8kxfCrlfLnTL+p5Uy9cuDCiO vRuuN8gv9cQajqm5AhuRSH4Qanl/kjFgtq5hemtwXNFZkfd4RD7+wbshxTnRJMT+efM1 CKliL93sCrXsFquVbFY8DtyoVXPJeotWYsXHGzP9vpxxxEhcjAMCaR6iYlbrylJ46Q21 fge0qNROv3TBjOo6J5qiGwfW+4gTlfJIgY230RpMDCDQ7mLVXBBfYytWBeUExqCOO3cg IqF631RWriVMpil29lMXcksoSSlFC73xrvm3pZjK+RcxZbtnoVl2Qj5fYh/OGoeml7l6 Wm1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=daV7f6edlBjE64Q8UviKTbVUx/C1ouI6DaLQnoPVZz4=; b=Cb4Nk9A/L7bLIoARgTevgRhOrOBhdpEJvfkpH/01XOctH3p1567hjBpWExfjx5aaF5 ubj5JIQvhr5bhhEtEsmNEg+uWGeJfUHWE5KXxEelQtNW7CqyhmR0Wicu7mYghW4oMNTf yNQ80rmZoqxueR0tipboumumlu+uMh9g9Js0lgBa+AAyUhjqG2kFPRkeDMvIpy8MheKs HIu3daTuc43qWK5peh6QRG8rebi5uAmMQ8twvHfnozbbY2smXXsBd7JEZka+feHp2Qbp rnYFj8cLUwqXaz3M5IpWVyTN4pWcp2s/U5RmykmOaRG8yE/cET+3E5H6g9yJgZ4uYH6J nzAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=qUQSNI+t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id w16si286552pll.62.2021.10.13.10.54.33; Wed, 13 Oct 2021 10:54:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=qUQSNI+t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S230313AbhJMRzG (ORCPT + 99 others); Wed, 13 Oct 2021 13:55:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229814AbhJMRzG (ORCPT ); Wed, 13 Oct 2021 13:55:06 -0400 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70F3DC061570 for ; Wed, 13 Oct 2021 10:53:02 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id u18so15220638lfd.12 for ; Wed, 13 Oct 2021 10:53:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=daV7f6edlBjE64Q8UviKTbVUx/C1ouI6DaLQnoPVZz4=; b=qUQSNI+tWAI3H3fGeeYhU04G3fOMAvst+PyBREFniFJzQeAaYYZvLlXjo4M2CdAbEk 33CBKZzgWQE/KbeysNTdrj/G4lK0ogEl1hoCYfF4lpRBHderFOC4xtnyz2dkuw52aKBa mgtXifvoYMLq4VkbrmT/456ybO9DIAiepjAsviCPet/52JMxo50teZTsE+9yOWZH/5vW vRb8P+fIQX+2QmLaA9tP0jRP7Hvi5YImPLxKZ8mWpc6CRrwZlm/8IV3/RM31yYy56SSb 2a314RhlkYp6Wv+dF8bEnFZ8q3iHxCcSwKoUTms7GIilHSgXy4iPReWA7lZjDodmxQ8z epqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=daV7f6edlBjE64Q8UviKTbVUx/C1ouI6DaLQnoPVZz4=; b=PNPk62voUfOVvQ1QkXG3Ibfnrr8zKc39bgzdifZQQpoVD/aeMLaZ0RTYYzed2VUY53 JCHcORygvqEh+VSF/u6EvRgPnm+ebblbVtX4M+a014wWyrE8OTDFXBDfEjTcGvsF86HC H7NrWgX816lLmupqScnpuvRe4B/ZtyDizLgR7N5JFCbr2KjdRX+BEcPBkiUfy4Sfbvnu mwBrLeW57a3C23rqIRDPKuhpK+ccxfKNcTe66UpcJwSdKNhBf/mF4IvRlL1BdpaW89OT QzuVjblAll7ih81Z4eXMaul1K+RBj8w0IQTgzO3FVaiw0TwT3o8lumzAircPB2rMNWP4 +AiQ== X-Gm-Message-State: AOAM533DaKlZNIBEeSkOUZNAMt6trU0qCg7E6icextRMbKdlJorUQQBx nGAjzD11lRZHsrWftKxFnl8Ui5wx3YHO7nGT56U= X-Received: by 2002:a05:6512:12d3:: with SMTP id p19mr460668lfg.280.1634147580783; Wed, 13 Oct 2021 10:53:00 -0700 (PDT) MIME-Version: 1.0 References: <20211006174910.2964885-1-daeho43@gmail.com> <5743eeca-a6e8-87d4-5799-c622fbada429@kernel.org> <16840026-35ba-cce6-4e0b-3332b0902d2a@kernel.org> In-Reply-To: <16840026-35ba-cce6-4e0b-3332b0902d2a@kernel.org> From: Daeho Jeong Date: Wed, 13 Oct 2021 10:52:49 -0700 Message-ID: Subject: Re: [f2fs-dev] [PATCH] f2fs: include non-compressed blocks in compr_written_block To: Chao Yu Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com, Daeho Jeong Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sorry, many parts of userspace already rely on these names. I wrote that compr_written_blocks shows the block count written after compression since mount. So, the count of blocks written as original data after compression because of no gain would not be an exception. Thanks, On Wed, Oct 13, 2021 at 7:17 AM Chao Yu wrote: > > On 2021/10/12 0:02, Daeho Jeong wrote: > >>> diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c > >>> index c1bf9ad4c220..9b663eaf4805 100644 > >>> --- a/fs/f2fs/compress.c > >>> +++ b/fs/f2fs/compress.c > >>> @@ -1530,6 +1530,7 @@ int f2fs_write_multi_pages(struct compress_ctx *cc, > >>> if (cluster_may_compress(cc)) { > >>> err = f2fs_compress_pages(cc); > >>> if (err == -EAGAIN) { > >>> + add_compr_block_stat(cc->inode, cc->cluster_size); > >> > >> Shouldn't we relocate this after 'write' label? > >> > >> One more concern, it looks we've changed what compr_block stat indicated, > >> literally, the block we account should be compressed..., how about accounting > >> it by introducing .presist_blocks, used_blocks or occupied_blocks.... thoughts? > >> > > > > What I wanted to add here is just one case in which compression was > > tried, but couldn't save any block, so gave up. > > If we put this below the "write" label, we will count blocks, even if > > the file is turned off for compression in "user-controlled > > compression" mode. > > Like the commit comment says, I want to estimate the overall compression rate. > > But, if we include every other compression disabled condition, it > > won't work like that. > > Got it, thanks for the explanation. > > Any thoughts about renaming compr_block? since some blocks accounted in > .compr_block weren't compressed blocks. > > Thanks, > > > > > Thanks, > >