All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrea Cervesato via ltp <ltp@lists.linux.it>
To: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] syscalls/process_madvise01: fix smaps scan and min_swap_avail
Date: Thu, 19 Oct 2023 10:58:19 +0200	[thread overview]
Message-ID: <1f088ac0-fac1-40c4-91eb-accf629daaee@suse.com> (raw)
In-Reply-To: <272dd7b41f4e1049c7428d2de2ac97814ed900ba.1697705468.git.jstancek@redhat.com>

Hi!

On 10/19/23 10:51, Jan Stancek wrote:
> smaps matching can prematurely end, because the comparison to "VmFlags"
> string is not exact. So depending on address on line, it can break
> before it finds Swap line. This makes the test fail on recent aarch64
> kernels.
>
> min_swap_avail per documentation is in MB not KB.
>
> Signed-off-by: Jan Stancek <jstancek@redhat.com>
> ---
>   testcases/kernel/syscalls/process_madvise/process_madvise.h   | 2 +-
>   testcases/kernel/syscalls/process_madvise/process_madvise01.c | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/testcases/kernel/syscalls/process_madvise/process_madvise.h b/testcases/kernel/syscalls/process_madvise/process_madvise.h
> index c4570e5309de..5b227ada099e 100644
> --- a/testcases/kernel/syscalls/process_madvise/process_madvise.h
> +++ b/testcases/kernel/syscalls/process_madvise/process_madvise.h
> @@ -54,7 +54,7 @@ static inline void read_address_mapping(unsigned long address, struct addr_mappi
>   		if (!found)
>   			continue;
>   
> -		if (found && strcmp(line, "VmFlags") >= 0)
> +		if (found && strncmp(line, "VmFlags", 7) == 0)
>   			break;
>   
>   		if (sscanf(line, "%31[^:]: %d", label, &value) > 0) {
> diff --git a/testcases/kernel/syscalls/process_madvise/process_madvise01.c b/testcases/kernel/syscalls/process_madvise/process_madvise01.c
> index 322b4cf60353..0fd3c1ef4f80 100644
> --- a/testcases/kernel/syscalls/process_madvise/process_madvise01.c
> +++ b/testcases/kernel/syscalls/process_madvise/process_madvise01.c
> @@ -123,7 +123,7 @@ static struct tst_test test = {
>   	.min_kver = "5.10",
>   	.needs_checkpoints = 1,
>   	.needs_root = 1,
> -	.min_swap_avail = MEM_CHILD / TST_KB,
> +	.min_swap_avail = MEM_CHILD / TST_MB,
>   	.needs_kconfigs = (const char *[]) {
>   		"CONFIG_SWAP=y",
>   		NULL

Thanks for fixing this.

Andrea Cervesato


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2023-10-19  8:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-19  8:51 [LTP] [PATCH] syscalls/process_madvise01: fix smaps scan and min_swap_avail Jan Stancek
2023-10-19  8:58 ` Andrea Cervesato via ltp [this message]
2023-10-27  8:50   ` Jan Stancek
2023-10-27  8:55     ` Andrea Cervesato via ltp
2023-10-27  9:49       ` Jan Stancek

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=1f088ac0-fac1-40c4-91eb-accf629daaee@suse.com \
    --to=ltp@lists.linux.it \
    --cc=andrea.cervesato@suse.com \
    /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.