From: Petr Vorel <pvorel@suse.cz>
To: Dennis Brendel <dbrendel@redhat.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2] munlockall: add test case that verifies memory has been unlocked
Date: Wed, 6 Mar 2024 11:07:15 +0100 [thread overview]
Message-ID: <20240306100715.GA532480@pevik> (raw)
In-Reply-To: <1a27ec16-e4ca-4790-81f7-8aac5e28cca4@redhat.com>
> On 3/5/24 22:30, Petr Vorel wrote:
> >> + SAFE_FILE_LINES_SCANF("/proc/self/status", "VmLck: %ld", &size);
> >> +
> >> + if (size == 0UL)
> >> + tst_brk(TBROK, "Locked memory after mlockall() should be "
> >> + "greater than 0, but is %ld", size);
> > I suppose < 0 really means no memory locked, thus really safe to quit before
> > munlockall(), right?
> Forgot to reply to that.
> < 0 should not happen due to unsigned type.
> If the size is 0 then it is safe to quit. In general it should always be safe
> to exit even if there was memory locked, i.e. when the parsing of
> /proc/self/status is faulty or when wrong numbers are reported.
Good point, thanks!
Kind regards,
Petr
> Dennis
--
Mailing list info: https://lists.linux.it/listinfo/ltp
prev parent reply other threads:[~2024-03-06 10:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-05 17:26 [LTP] [PATCH v2] munlockall: add test case that verifies memory has been unlocked Dennis Brendel
2024-03-05 21:30 ` Petr Vorel
2024-03-06 8:49 ` Dennis Brendel
2024-03-06 9:00 ` Dennis Brendel
2024-03-06 10:07 ` Petr Vorel [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=20240306100715.GA532480@pevik \
--to=pvorel@suse.cz \
--cc=dbrendel@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 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.