All of lore.kernel.org
 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 05:59:37 -0400 (EDT)	[thread overview]
Message-ID: <1695359151.30173908.1561543177520.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <CAEemH2d_7fq2RxEwZEMSUgErM7XG26RTsV1ogLTiLvALc810Gw@mail.gmail.com>


----- Original Message -----
> On Wed, Jun 26, 2019 at 4:20 PM Jan Stancek <jstancek@redhat.com> wrote:
> 
> >
> > ----- 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
> >
> 
> Er, sorry about still not working here.
> 
> If a system(e.g PowerKVM guest) configured with NO huge page support, then
> the file '/proc/sys/vm/nr_hugepages' exist but EOPNOTSUPP to read/write. In
> this key01, perhaps I shouldn't use the "/proc/.../nr_hugepages" to detect
> that at the beginning.
> 
> Seems the correct way is to use "/sys/kernel/mm/hugepages/" for huge page
> detecting and leave the SAFE_FILE_* still in setup(). Because we need to
> catch the "/proc/.../nr_hugepages" open/close or read/write issue in
> testing.

That should work, I see we used that in some tests already.

> 
> What do you think? Should we mask the EOPNOTSUPP as a TCONF skipping or
> others?
> 
> --
> Regards,
> Li Wang
> 

  reply	other threads:[~2019-06-26  9:59 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
2019-06-26  9:40     ` Li Wang
2019-06-26  9:59       ` Jan Stancek [this message]
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=1695359151.30173908.1561543177520.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 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.