Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp2988733pxb; Fri, 8 Oct 2021 21:45:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtCEFode+bDsY9Ozcl5qhCIeX8fiUll5P9Hqt1f+nx69tFSF6d4w8VcSiinKiysrX7pQqM X-Received: by 2002:a17:906:1706:: with SMTP id c6mr9422000eje.343.1633754749532; Fri, 08 Oct 2021 21:45:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633754749; cv=none; d=google.com; s=arc-20160816; b=ooZHbyqm4rXWV73VNTjXEJcS3Svtjf3oCxH6t29jUYDcmrY6KHvBnzC1rwWzSV2Cij QsuE13Y2nQ7CFO+7Wm2WFVIlfNkimYABws2FMF7fj8lJ6+k5jWh2p15oHv03vVvQZlFc wr6QRPqveENvFogua8QN3B81hwEgDYYnTbf/HtKZ8eaG6CU4zSO7qC9oAFHBAYgRZAHN 5PYNRMCv9n6Km3d1dDq10nYmAzpsrGGIbfmT9DKDmCCNHhUuAwFyFR64zEKg5HnD7zl0 78kR88bxQBaD9aDWcheZ+NsdgZuai2JD/y40J4YAzdyb6dR16TLx8O71yf1Y6yUDhVBH qeCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=o0fZsrtwYQJjSUkKVJhSstSDjNvgbFPWePz/qoVHLYw=; b=Qm12KZ66C0RtGW7XuaIqVdg2jIZUjxp/tLv4LwTL/jWmQKAuL8m0/S5JO+BiryhYY4 9dTI+rsTwxah8yH2Zd3JKQXbcM9ulux8tEDDyns7bf8dLRGW5MVtYzrZrW53IpSz7Fy3 I1KaCCdxCgrkYz+JvBZ8UXoR9uJ4XaLZSLWeYn4rrTm4tGVm7YP+a2/nPYwZa8yPKedq W0fKc8RnVQFtyGrg4dX6x6PFh4IRdO2jMG+Yd6yNArYyI67KCG0AR7TFIgAiuSXVB5Ym 40BCiRLwUXi+Ng1lA0WdliJ6YW6vbWSZx9j0XqNcYbytdhNsxBgRmRbwhXZCdhDM53Om gHGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jwZCIDoB; 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 br21si1969775ejb.612.2021.10.08.21.45.26; Fri, 08 Oct 2021 21:45:49 -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=jwZCIDoB; 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 S230125AbhJIEqH (ORCPT + 99 others); Sat, 9 Oct 2021 00:46:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:36694 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229596AbhJIEqG (ORCPT ); Sat, 9 Oct 2021 00:46:06 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 46C6160FD7; Sat, 9 Oct 2021 04:44:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1633754650; bh=/DP0YNGWaWd7IkbhoG4Fi8yCcVeNmnaI1/+O1tyTZi8=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=jwZCIDoBye/Db5VufJzbIarfc+pif9cRf1j2M4Mnrx5InfLvcMXzyQPV3EemCANUJ 0KKBPdm3oSzw1oKXkn9Njun5N50wmkIr6CleARVZTVIS+uyEj3FQZ7O/cS29QOPhn1 RaOSDCuLmU2kOq2VpXADX51Qxxwgc01oWDsMxRJZHBQV+fv42eD9n33bvw9x282iWI N3670y6IXzlHy1nt/fOwzJPPyBCgL92Cf4x5mOfMFDNjed7jvNQNvpTU3UBNBPqt21 VuqQBXGs1UfhktCyEMliLaCGb/lGeLl8UDd+NUPqSXop3nDjSTgW4AgvWyNIQCkQyO RuLXWMwiGTC1A== Subject: Re: [f2fs-dev] [PATCH] f2fs: include non-compressed blocks in compr_written_block To: Daeho Jeong , linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com Cc: Daeho Jeong References: <20211006174910.2964885-1-daeho43@gmail.com> From: Chao Yu Message-ID: <5743eeca-a6e8-87d4-5799-c622fbada429@kernel.org> Date: Sat, 9 Oct 2021 12:44:07 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20211006174910.2964885-1-daeho43@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/10/7 1:49, Daeho Jeong wrote: > From: Daeho Jeong > > Need to include non-compressed blocks in compr_written_block to > estimate average compression ratio more accurately. > > Signed-off-by: Daeho Jeong > --- > fs/f2fs/compress.c | 1 + > 1 file changed, 1 insertion(+) > > 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? Thanks, > goto write; > } else if (err) { > f2fs_put_rpages_wbc(cc, wbc, true, 1); >