From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH RFC 2/2] swapping01: check memory swap usage per process
Date: Mon, 25 Jan 2021 09:28:46 +0100 [thread overview]
Message-ID: <YA6BPtiWooSjiiUt@pevik> (raw)
In-Reply-To: <20210125064747.26759-2-liwang@redhat.com>
Hi Li,
> Since previously swapping01 read the system FreeSwap for counting
> usage of swap-size, that's not precise on system especially with
> eating-memory daemon?in the background. Now, we try to check the
> 'VmmSwap' in proc/PID/status?per process, to get rid of?the potential
> influence from?other processes?which easily leads to false positive.
LGTM.
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Kind regards,
Petr
> Signed-off-by: Li Wang <liwang@redhat.com>
> Cc: Petr Vorel <pvorel@suse.cz>
> Cc: Alexander Egorenkov <egorenar@linux.ibm.com>
> ---
> testcases/kernel/mem/swapping/swapping01.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
> diff --git a/testcases/kernel/mem/swapping/swapping01.c b/testcases/kernel/mem/swapping/swapping01.c
> index 8106f6466..0f693f313 100644
> --- a/testcases/kernel/mem/swapping/swapping01.c
> +++ b/testcases/kernel/mem/swapping/swapping01.c
> @@ -137,8 +137,7 @@ static void check_swapping(void)
> i++;
> }
> - swap_free_now = SAFE_READ_MEMINFO("SwapFree:");
> - swapped = swap_free_init - swap_free_now;
> + swapped = SAFE_READ_PROC_STATUS(pid, "VmSwap:");
> if (swapped > mem_over_max) {
> kill(pid, SIGCONT);
> tst_brk(TFAIL, "heavy swapping detected: "
next prev parent reply other threads:[~2021-01-25 8:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-25 6:47 [LTP] [PATCH RFC 1/2] lib: add SAFE_READ_PROC_STATUS macro Li Wang
2021-01-25 6:47 ` [LTP] [PATCH RFC 2/2] swapping01: check memory swap usage per process Li Wang
2021-01-25 8:28 ` Petr Vorel [this message]
2021-01-25 15:25 ` Cyril Hrubis
2021-01-26 5:25 ` Li Wang
2021-02-24 8:04 ` Li Wang
2021-01-25 8:29 ` [LTP] [PATCH RFC 1/2] lib: add SAFE_READ_PROC_STATUS macro Petr Vorel
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=YA6BPtiWooSjiiUt@pevik \
--to=pvorel@suse.cz \
--cc=ltp@lists.linux.it \
/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