[LTP] The problem of compression ratio calculation in zram01

xuyang2018.jy@fujitsu.com xuyang2018.jy@fujitsu.com
Tue Dec 14 08:57:31 CET 2021


Hi

Before ltp commit 4372f7a2156 ("Fix compression ratio calculation in
zram01")[1], we used free -m changes to calculate the compression ratio.

After this patch, we used compr_data_size to calculate.

kernel documentation[2] has the following info:

orig_data_size: uncompressed size of data stored in this disk.

compr_data_size: compressed size of data stored in this disk

mem_used_total: the amount of memory allocated for this disk

IMO, this patch changes old test's purpose and we should use
mem_used_total field instead of compr_data_size(orig_data_size and
compr_data_size should be dynamic adjusted by system, so using it in
here is meaningless).

ps: If I understand wrong, please correct me.

[1]https://github.com/linux-test-project/ltp/commit/4372f7a215633e55f423dc09ec50650c142dca77
[2]https://www.kernel.org/doc/html/v5.3/admin-guide/blockdev/zram.html

Best Regards
Yang Xu


More information about the ltp mailing list