From: Xiao Yang <yangx.jy@cn.fujitsu.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 3/4] syscalls/mlock201: Add new testcase
Date: Thu, 30 Aug 2018 09:17:22 +0800 [thread overview]
Message-ID: <5B8745A2.7010005@cn.fujitsu.com> (raw)
In-Reply-To: <1936332281.43470556.1535546553712.JavaMail.zimbra@redhat.com>
On 2018/08/29 20:42, Jan Stancek wrote:
> ----- Original Message -----
>> ----- Original Message -----
>>> Check the basic functionality of mlock2(2) since kernel v2.6.9.
> Missed this one:
> mlock2() is available since Linux 4.4.
Hi Jan,
Thanks for your review.
It seems that mlock2() has been backported by some distros(e.g.
RHEL7.6), so i use tst_syscall()
instead of .min_kver to check if mlock2() is supported.
From mlock2() manpage:
Before Linux 2.6.8, a process must be privileged (CAP_IPC_LOCK) in order
to lock memory and the
RLIMIT_MEMLOCK soft resource limit defines a limit on how much memory
the process may lock.
Since Linux 2.6.9, no limits are placed on the amount of memory that a
privileged process can lock
and the RLIMIT_MEMLOCK soft resource limit instead defines a limit on
how much memory an unprivileged\
process may lock.
I just check the behavior of mlock2() since Linux 2.6.9.
>>> Signed-off-by: Xiao Yang<yangx.jy@cn.fujitsu.com>
>>> + * Description:
>>> + * Check the basic functionality of the mlock2(2) since kernel v2.6.9:
>>> + * 1) Use mlock2(2) without MLOCK_ONFAULT to lock memory in the specified
>>> + * range that is multiples of page size or not, and the VmLck from
>>> + * /proc/PID/status shows correct size of memory that is locked by PID.
>>> + * 2) Use mlock2(2) with MLOCK_ONFAULT to lock memory in the specified
>>> + * range that is multiples of page size or not, and the VmLck from
>>> + * /proc/PID/status show correct size of memory that is locked by PID.
>> Can we also check if MLOCK_ONFAULT doesn't make non-present pages present,
>> but it still locks present pages? (mincore(2) or /proc/pid/pagemap)
I will try to check this point as you suggested.
Thanks,
Xiao Yang
>> Regards,
>> Jan
>>
>> --
>> Mailing list info: https://lists.linux.it/listinfo/ltp
>>
>
>
next prev parent reply other threads:[~2018-08-30 1:17 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-21 9:38 [LTP] [PATCH 1/4] lapi/syscalls: Add syscall numbers for mlock2 Xiao Yang
2018-08-21 9:38 ` [LTP] [PATCH 2/4] safe_macros: Add SAFE_MLOCK() and SAFE_MUNLOCK() macros Xiao Yang
2018-08-29 12:11 ` Jan Stancek
2018-08-21 9:38 ` [LTP] [PATCH 3/4] syscalls/mlock201: Add new testcase Xiao Yang
2018-08-29 12:19 ` Jan Stancek
2018-08-29 12:42 ` Jan Stancek
2018-08-30 1:17 ` Xiao Yang [this message]
2018-08-31 7:13 ` [LTP] [PATCH v2 " Xiao Yang
2018-08-30 12:41 ` Jan Stancek
2018-08-31 7:13 ` [LTP] [PATCH v2 4/4] syscalls/mlock202: " Xiao Yang
2018-08-30 12:43 ` Jan Stancek
2018-09-04 8:10 ` Jan Stancek
2018-08-21 9:38 ` [LTP] [PATCH " Xiao Yang
2018-08-29 12:44 ` Jan Stancek
2018-08-30 7:41 ` Xiao Yang
2018-08-29 12:11 ` [LTP] [PATCH 1/4] lapi/syscalls: Add syscall numbers for mlock2 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=5B8745A2.7010005@cn.fujitsu.com \
--to=yangx.jy@cn.fujitsu.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