public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Jan Stancek <jstancek@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v4 2/2] pkey: add test for memory protection keys
Date: Wed, 26 Jun 2019 04:19:54 -0400 (EDT)	[thread overview]
Message-ID: <285629943.30156546.1561537194409.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20190626071538.29486-2-liwang@redhat.com>


----- Original Message -----
> +
> +static void setup(void)
> +{
> +	int i, fd;
> +
> +	if (access(PATH_VM_NRHPS, F_OK)) {
> +		tst_res(TINFO, "Huge page is not supported");
> +		size = getpagesize();
> +		no_hugepage = 1;
> +	} else {
> +		int val;
> +
> +		SAFE_FILE_PRINTF(PATH_VM_NRHPS, "%d", 1);

This is still SAFE write, which may trigger TBROK:

# ./pkey01 
tst_test.c:1100: INFO: Timeout per run is 0h 05m 00s
safe_file_ops.c:301: BROK: Failed to close FILE '/proc/sys/vm/nr_hugepages' at pkey01.c:67: EOPNOTSUPP
safe_macros.c:773: WARN: pkey01.c:91: umount(tmp_pkey) failed: ENOENT
safe_macros.c:184: WARN: pkey01.c:92: rmdir(tmp_pkey) failed: ENOENT

> +
> +		SAFE_FILE_SCANF(PATH_VM_NRHPS, "%d", &val);

safe_file_ops.c:157: BROK: The FILE '/proc/sys/vm/nr_hugepages' ended prematurely at pkey01.c:69

> +		if (val != 1)
> +			tst_brk(TBROK, "nr_hugepages = %d, but expect %d",
> +					val, 1);
> +
> +		size = SAFE_READ_MEMINFO("Hugepagesize:") * 1024;
> +	}
> +


  reply	other threads:[~2019-06-26  8:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-26  7:15 [LTP] [PATCH v4 1/2] pkey: add syscall numbers for pkey Li Wang
2019-06-26  7:15 ` [LTP] [PATCH v4 2/2] pkey: add test for memory protection keys Li Wang
2019-06-26  8:19   ` Jan Stancek [this message]
2019-06-26  9:40     ` Li Wang
2019-06-26  9:59       ` Jan Stancek
2019-07-01  7:11         ` Li Wang
2019-07-01  7:23           ` 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=285629943.30156546.1561537194409.JavaMail.zimbra@redhat.com \
    --to=jstancek@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