Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3502501pxb; Wed, 13 Oct 2021 07:19:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVhliW8NN4Hr3VMPo//Vr/INgcf/vK9z8ABx/jj4EpZCZLc8dYRKOd/nNW9+xiEbvZvNHu X-Received: by 2002:a50:cf48:: with SMTP id d8mr10141797edk.293.1634134762675; Wed, 13 Oct 2021 07:19:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634134762; cv=none; d=google.com; s=arc-20160816; b=UK8STLJWI62s0hFfhnLkg8ayuxEsrr+GH+XtfcY9JCxBWxtuMks1ozVzmXswro+0iq CUkhE//Rzks9Bh9DYXt1X0+fnfxZRbQNEDz9Y79+0/QbC829rHtwfNnCIj2fmDi2dEms /92sFz6cGyl4cSF+XjWdBeqR7G1EHKGxvHfLgrOsyl5XxhRBCV3obhFtBhxiPn9I+RY8 JLahAG7SMDVpoNiBhjnBDXGfGBn8m3D/57jZ+SGqkMvLkpUI+eaZ+5o/N13thN/yyO/K KqNUhvY92hA0+QAXEjlkX05hLoDgtvurPHl+ZrlxOcnT+vS4iBDHfATKNpDepLb/Qnl4 3HQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Z66hH6f+rrfNA6LO5TQwnmVmx66BPz+M0IFUmUdgPDI=; b=OBnvAYuC/SgXoU5FytJjJpxpP+7C6/k2IdzIYd9Gcc4Vct1WXqRCmpNc2j9l8glDpw Qmitc45nLjq4lWcBAQIsZ0CxXnLkKWwogt46UY4ajuKApTBYaK5mm4F7bohmWc+dMVUt xc7y4G+2E/XAu09lmV83Qk8rhSKtLVFydgkqd6uAR4iF7avjF2UB5Kh1pf/VCAvpx3N5 gBRx812wS9sVAKQe2M0a2kjvcAijlSgCNjA+M3C1xtzGPjR5VCGaay6R+Jcl1BEeDT0S nH0rZfiQ2VweyYHeKbaYpSU8bzSIyDnYtB66kpt9x4OMFZcXrtMrNvz7JaNzImy6VC7k ccgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fV7TI00+; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 10si20657909ejx.649.2021.10.13.07.18.57; Wed, 13 Oct 2021 07:19:22 -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=@kernel.org header.s=k20201202 header.b=fV7TI00+; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233918AbhJMOTS (ORCPT + 99 others); Wed, 13 Oct 2021 10:19:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:36522 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229562AbhJMOTR (ORCPT ); Wed, 13 Oct 2021 10:19:17 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AB85D60F4A; Wed, 13 Oct 2021 14:17:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634134634; bh=xGaUNIV0JKCxDoZu8SaySJLNpamLkm5J0/iXLpj5oJ4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=fV7TI00+eX44IfKk43MRiPWw5rHehObyw2gsMLdynvyHhM7Bx+TChWOLGcPqWQJG2 /CXcQxGIR5ObaCM8iH9OyAJlr6L+hzpsclbrm8p2GCFJRSzBqNRAVmfWTOF53dGrf3 lVHHk513wRQoOiQOgFxR+2Q2E0GIE0BMK/da3bwp2aETMan2SrnFHLdkW2/1kDBNdv Gxtmo23g8eQt+0OpBCbREiQ4yJVnKei/8jzLvYecRJja++ucvCX8MtK6lIxl8wfP3B c16idrtcnNcSpDpae/vbjCo4gIMQo9dXsskVfrPuHYF14ufeizfiscnRzaUSoqqm8d F1Wd7kCqB06uw== Message-ID: <16840026-35ba-cce6-4e0b-3332b0902d2a@kernel.org> Date: Wed, 13 Oct 2021 22:17:07 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: [f2fs-dev] [PATCH] f2fs: include non-compressed blocks in compr_written_block Content-Language: en-US To: Daeho Jeong Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com, Daeho Jeong References: <20211006174910.2964885-1-daeho43@gmail.com> <5743eeca-a6e8-87d4-5799-c622fbada429@kernel.org> From: Chao Yu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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, >