lkml.org 
[lkml]   [2021]   [Oct]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [f2fs-dev] [PATCH] f2fs: include non-compressed blocks in compr_written_block
From
Date
On 2021/10/7 1:49, Daeho Jeong wrote:
> From: Daeho Jeong <daehojeong@google.com>
>
> Need to include non-compressed blocks in compr_written_block to
> estimate average compression ratio more accurately.
>
> Signed-off-by: Daeho Jeong <daehojeong@google.com>
> ---
> 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);
>

\
 
 \ /
  Last update: 2021-10-09 06:45    [W:0.206 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site