From: Andrea Cervesato via ltp <ltp@lists.linux.it>
To: Jan Stancek <jstancek@redhat.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] syscalls/process_madvise01: fix smaps scan and min_swap_avail
Date: Fri, 27 Oct 2023 10:55:27 +0200 [thread overview]
Message-ID: <55b7a1e5-698a-4a0f-91c8-c0bb5e6423e1@suse.com> (raw)
In-Reply-To: <CAASaF6zYqm+ct9C0unRHZfg0z74xyeSu6hOrXzyKNV1peWZcwg@mail.gmail.com>
Hi,
On 10/27/23 10:50, Jan Stancek wrote:
> On Thu, Oct 19, 2023 at 10:58 AM Andrea Cervesato via ltp
> <ltp@lists.linux.it> wrote:
>> 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.
> Could I add your Reviewed/Acked-by to the patch?
Yes please.
Acked-by: Andrea Cervesato <andrea.cervesato@mailbox.org>
>
>> Andrea Cervesato
>>
>>
>> --
>> Mailing list info: https://lists.linux.it/listinfo/ltp
>>
Andrea Cervesato
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2023-10-27 8:55 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
2023-10-27 8:50 ` Jan Stancek
2023-10-27 8:55 ` Andrea Cervesato via ltp [this message]
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=55b7a1e5-698a-4a0f-91c8-c0bb5e6423e1@suse.com \
--to=ltp@lists.linux.it \
--cc=andrea.cervesato@suse.com \
--cc=jstancek@redhat.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.