From: Richard Palethorpe <rpalethorpe@suse.de>
To: Ralph Siemsen <ralph.siemsen@linaro.org>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] lib: fix MemAvailable parsing
Date: Wed, 29 Sep 2021 09:14:56 +0100 [thread overview]
Message-ID: <87ee97g5gi.fsf@suse.de> (raw)
In-Reply-To: <20210928021850.2015065-1-ralph.siemsen@linaro.org>
Hello Ralph,
Ralph Siemsen <ralph.siemsen@linaro.org> writes:
> The amount of available memory was not being returned correctly, which
> resulted in tests being executed when they should have been skipped.
>
> Fixes: 8759f4 ("lib: adjust the tmpfs size according to .dev_min_size and MemAvailable")
> Signed-off-by: Ralph Siemsen <ralph.siemsen@linaro.org>
> ---
> lib/tst_memutils.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lib/tst_memutils.c b/lib/tst_memutils.c
> index 69077861f..90911da56 100644
> --- a/lib/tst_memutils.c
> +++ b/lib/tst_memutils.c
> @@ -65,9 +65,9 @@ void tst_pollute_memory(size_t maxsize, int fillchar)
>
> long long tst_available_mem(void)
> {
> - long long mem_available;
> + long long mem_available = 0;
>
> - if (FILE_LINES_SCANF("/proc/meminfo", "MemAvailable: %ld",
> + if (FILE_LINES_SCANF("/proc/meminfo", "MemAvailable: %lld",
> &mem_available)) {
> mem_available = SAFE_READ_MEMINFO("MemFree:")
> + SAFE_READ_MEMINFO("Cached:");
> --
> 2.25.1
Just curious, did you find this on 32-bit ARM?
Anyway looks correct.
Reviewed-by: Richard Palethorpe <rpalethorpe@suse.com>
--
Thank you,
Richard.
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2021-09-29 8:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-28 2:18 [LTP] [PATCH] lib: fix MemAvailable parsing Ralph Siemsen
2021-09-28 7:59 ` Li Wang
2021-09-29 8:14 ` Richard Palethorpe [this message]
2021-09-29 14:28 ` Ralph Siemsen
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=87ee97g5gi.fsf@suse.de \
--to=rpalethorpe@suse.de \
--cc=ltp@lists.linux.it \
--cc=ralph.siemsen@linaro.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox