linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [f2fs-dev] [f2fs-devel] Why does f2fs not reduce disk space when compression is on?
@ 2021-04-12 13:13 Fengnan Chang
  2021-04-13  1:15 ` Chao Yu
  0 siblings, 1 reply; 3+ messages in thread
From: Fengnan Chang @ 2021-04-12 13:13 UTC (permalink / raw)
  To: jaegeuk, chao; +Cc: linux-f2fs-devel

I'm testing the f2fs data compression feature. I created a new FS with the flags extra_attr and compression,
use chattr -R +c on the test dir to enable compression for the directory. 
I found that when compression was turned on, the files did not take up any less space.
Using trace, I see that the data is indeed compressed.
Is there a mistake in my testing method, or is this how it was designed and why?

This is my test method:

# mount
/dev/nvme0n1 on /mnt type f2fs (rw,lazytime,relatime,background_gc=on,discard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,alloc_mode=reuse,fsync_mode=posix,compress_algorithm=lz4,compress_log_size=2)
# df 
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root               114901    112444         0 100% /
devtmpfs                497436         0    497436   0% /dev
tmpfs                   500060         0    500060   0% /dev/shm
tmpfs                   500060        52    500008   0% /tmp
tmpfs                   500060        20    500040   0% /run
/dev/nvme0n1          10483712    499724   9983988   5% /mnt
# mkdir test
# chattr -R +c test/
# dd if=/dev/zero of=/mnt/test/file bs=1M count=100
# sync
# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root               114901    112444         0 100% /
devtmpfs                497436         0    497436   0% /dev
tmpfs                   500060         0    500060   0% /dev/shm
tmpfs                   500060       368    499692   0% /tmp
tmpfs                   500060        20    500040   0% /run
/dev/nvme0n1          10483712    602232   9881480   6% /mnt


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-13  1:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-12 13:13 [f2fs-dev] [f2fs-devel] Why does f2fs not reduce disk space when compression is on? Fengnan Chang
2021-04-13  1:15 ` Chao Yu
2021-04-13  1:44   ` [f2fs-dev] 答复: " changfengnan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).