Hi,

On 06/21, Michael Opdenacker via Linux-f2fs-devel wrote:
> Greetings,
> 
> I'm trying to compare the performance of the various compression options in
> f2fs versus the default settings, on an SD card.
> 
> Here's what I'm doing:
> 
>  * Creating the filesystem:
>    mkfs.f2fs -f -l data -O compression,extra_attr /dev/mmcblk0p3
>  * Mounting the filesystem:
>    mount -o compress_algorithm=zstd:22 /dev/mmcblk0p3 /mnt/data

This doesn't try to compress any file. Do we want to compress what files?
That can be specified by the extention name like:
# mount -o compress_extension=bar,compress_algorithm=zstd:22 ...

Or, you can set compression flag:
# touch foo.bar
# chattr +c foo.bar
# write() to foo.bar

You can check the number of compressed blocks by:
# f2fs_io get_cblocks foo.bar

If you want to reclaim the compressed blocks, you need to do:
# f2fs_io release_cblocks foo.bar

This will make the file as Read-Only which doesn't allow to update data in a
file. If you want to write a data, please do
# f2fs_io reserve_cblocks foo.bar

Thanks,

> 
> I'm running the tests on the Beaglebone Black board with a single-core 1GHz
> ARM CPU, using Linux 6.3.6. I'm using mkfs.f2fs 1.15.0 (2022-05-13), built
> by Buildroot.
> 
> However, I see no significant difference in terms of disk usage, read and
> write time, typically when I write and read an ARM root filesystem (from the
> Raspberry Pi Lite distro), compared to creating and mounting the filesystem
> with no special options. On Btrfs, the differences between compression
> options are really important.
> 
> I chose zstd:22 because I expected it to be the slowest choice in terms of
> compression. I'm expecting all files to be compressed (if they are
> compressible) by default.
> 
> Am I missing anything?
> 
> Thanks in advance,
> 
> Michael.
> 
> -- 
> Michael Opdenacker, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
> 
> 
> 
> _______________________________________________
> Linux-f2fs-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to