($INBOX_DIR/description missing)
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Filippo Storniolo <fstornio@redhat.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2] syscalls/mlock05: add mlock test for locking and pre-faulting of memory
Date: Thu, 2 May 2024 12:09:04 +0200	[thread overview]
Message-ID: <ZjNmQBfgqBzyUow7@yuki> (raw)
In-Reply-To: <CAHzY_-7DrwOOtawRziNo0CRS=VbEeNWF_sX_COpPaw_9s+J2nw@mail.gmail.com>

Hi!
> After some investigation, I realized the issue is caused by the
> unreliability of the VmRSS field in /proc/$pid/status.
> Documentation suggests to use /proc/$pid/smaps for reliable information.
> 
> This file contains information about each memory mapping, so it contains
> multiple instances of the VmRss field (In this file is simply referred as
> Rss).
> 
> I managed to run the test without any failures using a custom function.
> What we need to do is to iterate through the memory mappings until we find
> the one we need. We can use the memory address retrieved by mmap to locate
> the desired one.
> 
> Once we find the mapping, we can then search the Rss field.
> 
> This is the output I had using this approach:
> 
> TPASS: Expect: (VmRSS=1048576) >= (MMAPLEN=1048576)
> TPASS: VmLck == MMAPLEN (1048576)
> 
> Summary:
> passed  20000
> failed   0
> broken   0
> skipped  0
> warnings 0
> 
> Do you think this can work as a solution or you prefer another way around?

Looking up the right mapping and checking that the size of the resident
set is as expected sounds good to me.

-- 
Cyril Hrubis
chrubis@suse.cz

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

      reply	other threads:[~2024-05-02 10:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-29 13:33 [LTP] [PATCH v2] syscalls/mlock05: add mlock test for locking and pre-faulting of memory Filippo Storniolo
2024-04-29 13:48 ` Cyril Hrubis
2024-05-02  9:12   ` Filippo Storniolo
2024-05-02 10:09     ` Cyril Hrubis [this message]

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=ZjNmQBfgqBzyUow7@yuki \
    --to=chrubis@suse.cz \
    --cc=fstornio@redhat.com \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).