From: "xuyang2018.jy@fujitsu.com" <xuyang2018.jy@fujitsu.com>
To: Petr Vorel <pvorel@suse.cz>
Cc: Martin Doucha <martin.doucha@suse.com>,
"ltp@lists.linux.it" <ltp@lists.linux.it>
Subject: Re: [LTP] [PATCH v4 4/4] zram/zram01.sh: Use mem_used_total field instead of compr_data_size field
Date: Fri, 17 Dec 2021 09:45:41 +0000 [thread overview]
Message-ID: <61BC5C4A.8060502@fujitsu.com> (raw)
In-Reply-To: <YbxOtyzYsbgZ578D@pevik>
Hi Petr
> Hi,
>
> [ Cc Martin ]
>
>> Before ltp commit 4372f7a2156 ("Fix compression ratio calculation in zram01")[1], we
>> used free -m changes to calculate the compression ratio.
>
>> After the above 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
>
>> We should calculate the compression ratio by used disk size divided into used mem size.
>> It can also avoid the situation that division by 0 as below:
>> zram01 7 TINFO: filling zram4 (it can take long time)
>> zram01 7 TPASS: zram4 was filled with '25568' KB
>> zram01 7 TINFO: compr_size 0
>> /opt/ltp/testcases/bin/zram01.sh: line 131: 100 * 1024 * 25568 / 0: division by 0 (error token is "0")
>
> Thank you for addressing this issue. replacing "data *stored* in this disk" with
> "*allocated* for this disk" could help (although looking at kernel code
> mm_stat_show(), I would not be sure).
Sound reasonable.
Will send a v5 next week and wait some time to listen more advise from
others for this patchset.
Best Regards
Yang Xu
>
> Reviewed-by: Petr Vorel<pvorel@suse.cz>
>
> Kind regards,
> Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2021-12-17 9:45 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-15 7:20 [LTP] [PATCH v4 1/4] swapping01: skip test if zram-swap is being used Yang Xu
2021-12-15 7:20 ` [LTP] [PATCH v4 2/4] zram/zram_lib.sh: adapt the situation that zram device " Yang Xu
2021-12-17 7:48 ` Petr Vorel
2021-12-17 9:34 ` xuyang2018.jy
2021-12-17 10:34 ` Petr Vorel
2021-12-20 2:58 ` xuyang2018.jy
2021-12-20 8:52 ` Petr Vorel
2021-12-17 7:49 ` Petr Vorel
2021-12-15 7:20 ` [LTP] [PATCH v4 3/4] zram/zram03: Convert into new api Yang Xu
2021-12-17 8:22 ` Petr Vorel
2021-12-17 9:42 ` xuyang2018.jy
2021-12-17 8:24 ` Petr Vorel
2021-12-15 7:20 ` [LTP] [PATCH v4 4/4] zram/zram01.sh: Use mem_used_total field instead of compr_data_size field Yang Xu
2021-12-17 8:47 ` Petr Vorel
2021-12-17 9:45 ` xuyang2018.jy [this message]
2021-12-17 10:36 ` Petr Vorel
2021-12-17 7:01 ` [LTP] [PATCH v4 1/4] swapping01: skip test if zram-swap is being used Petr Vorel
2021-12-17 7:04 ` xuyang2018.jy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=61BC5C4A.8060502@fujitsu.com \
--to=xuyang2018.jy@fujitsu.com \
--cc=ltp@lists.linux.it \
--cc=martin.doucha@suse.com \
--cc=pvorel@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.