All of lore.kernel.org
 help / color / mirror / Atom feed
* [f2fs-dev] Trying to use compression options in f2fs
@ 2023-06-21 15:48 Michael Opdenacker via Linux-f2fs-devel
  2023-06-22  6:56 ` Jaegeuk Kim
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Opdenacker via Linux-f2fs-devel @ 2023-06-21 15:48 UTC (permalink / raw)
  To: linux-f2fs-devel; +Cc: michael.opdenacker

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

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
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

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

* Re: [f2fs-dev] Trying to use compression options in f2fs
  2023-06-21 15:48 [f2fs-dev] Trying to use compression options in f2fs Michael Opdenacker via Linux-f2fs-devel
@ 2023-06-22  6:56 ` Jaegeuk Kim
  2023-06-22  8:22   ` Michael Opdenacker via Linux-f2fs-devel
  0 siblings, 1 reply; 3+ messages in thread
From: Jaegeuk Kim @ 2023-06-22  6:56 UTC (permalink / raw)
  To: Michael Opdenacker; +Cc: linux-f2fs-devel

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
> Linux-f2fs-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


_______________________________________________
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

* Re: [f2fs-dev] Trying to use compression options in f2fs
  2023-06-22  6:56 ` Jaegeuk Kim
@ 2023-06-22  8:22   ` Michael Opdenacker via Linux-f2fs-devel
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Opdenacker via Linux-f2fs-devel @ 2023-06-22  8:22 UTC (permalink / raw)
  To: Jaegeuk Kim; +Cc: linux-f2fs-devel

Hi,

Many thanks for the tips!

On 22.06.23 at 08:56, Jaegeuk Kim wrote:
> 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

Actually, I was looking for a way to compress all files by default, and 
I overlooked "compress_extension=*" which should work for all files, in 
particular the binaries in the root filesystem which don't have any 
particular extension.

Thanks again
Cheers
Michael.

-- 
Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



_______________________________________________
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:[~2023-06-22  8:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-21 15:48 [f2fs-dev] Trying to use compression options in f2fs Michael Opdenacker via Linux-f2fs-devel
2023-06-22  6:56 ` Jaegeuk Kim
2023-06-22  8:22   ` Michael Opdenacker via Linux-f2fs-devel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.