All of lore.kernel.org
 help / color / mirror / Atom feed
From: rppt at linux.vnet.ibm.com (Mike Rapoport)
Subject: [PATCH v2 4/4] userfaultfd: selftest: Cope if shmem doesn't support zeropage
Date: Tue, 28 Aug 2018 09:15:11 +0300	[thread overview]
Message-ID: <20180828061510.GA25317@rapoport-lnx> (raw)
In-Reply-To: <87zhx7rywm.fsf@morokweng.localdomain>

On Mon, Aug 27, 2018 at 11:46:33PM -0300, Thiago Jung Bauermann wrote:
> 
> Hello Mike,
> 
> Mike Rapoport <rppt at linux.vnet.ibm.com> writes:
> 
> > Hi,
> >
> > On Fri, Aug 03, 2018 at 07:00:46PM -0300, Thiago Jung Bauermann wrote:
> >> If userfaultfd runs on a system that doesn't support UFFDIO_ZEROPAGE for
> >> shared memory, it currently ends with error code 1 which indicates test
> >> failure:
> >>
> >>   # ./userfaultfd shmem 10 10
> >>   nr_pages: 160, nr_pages_per_cpu: 80
> >>   bounces: 9, mode: rnd poll, unexpected missing ioctl for anon memory
> >>   # echo $?
> >>   1
> >>
> >> Change userfaultfd_zeropage_test() to return KSFT_SKIP to indicate that
> >> the test is being skipped.
> >
> > I took a deeper look at what userfaultfd_zeropage_test() does and,
> > apparently, I've mislead you. The test checks if the range has
> > UFFDIO_ZEROPAGE and verifies that it works if yes; otherwise the test
> > verifies that EINVAL is returned.
> >
> > Can you please check if the patch below works in your environment?
> >
> > From 7a34c84c0461b5073742275638c44b6535d19166 Mon Sep 17 00:00:00 2001
> > From: Mike Rapoport <rppt at linux.vnet.ibm.com>
> > Date: Tue, 7 Aug 2018 09:44:19 +0300
> > Subject: [PATCH] userfaultfd: selftest: make supported range ioctl
> >  verification more robust
> >
> > When userfaultfd tests runs on older kernel that does not support
> > UFFDIO_ZEROPAGE for shared memory it fails at the ioctl verification.
> >
> > Split out the verification that supported ioctls are superset of the
> > expected ioctls and relax the checks for UFFDIO_ZEROPAGE for shared memory
> > areas.
> >
> > Signed-off-by: Mike Rapoport <rppt at linux.vnet.ibm.com>
> > ---
> >  tools/testing/selftests/vm/userfaultfd.c | 63 +++++++++++++++++---------------
> >  1 file changed, 34 insertions(+), 29 deletions(-)
> 
> I'm sorry to take this long to respond, I was only able to get back to
> this today.

No problem :)

> Your patch does solve my problem. Thank you very much!
> 
> It has a trivial conflict in the second hunk with patch 3 in my series.
> Should I repost the series with your patch in place of patch 4?

Yep.
 
> --
> Thiago Jung Bauermann
> IBM Linux Technology Center

-- 
Sincerely yours,
Mike.

WARNING: multiple messages have this Message-ID (diff)
From: rppt@linux.vnet.ibm.com (Mike Rapoport)
Subject: [PATCH v2 4/4] userfaultfd: selftest: Cope if shmem doesn't support zeropage
Date: Tue, 28 Aug 2018 09:15:11 +0300	[thread overview]
Message-ID: <20180828061510.GA25317@rapoport-lnx> (raw)
Message-ID: <20180828061511.QLvO2_HfJcJLxWiiYZMHfdm6et78PgSuH4XxUblIdTE@z> (raw)
In-Reply-To: <87zhx7rywm.fsf@morokweng.localdomain>

On Mon, Aug 27, 2018@11:46:33PM -0300, Thiago Jung Bauermann wrote:
> 
> Hello Mike,
> 
> Mike Rapoport <rppt at linux.vnet.ibm.com> writes:
> 
> > Hi,
> >
> > On Fri, Aug 03, 2018@07:00:46PM -0300, Thiago Jung Bauermann wrote:
> >> If userfaultfd runs on a system that doesn't support UFFDIO_ZEROPAGE for
> >> shared memory, it currently ends with error code 1 which indicates test
> >> failure:
> >>
> >>   # ./userfaultfd shmem 10 10
> >>   nr_pages: 160, nr_pages_per_cpu: 80
> >>   bounces: 9, mode: rnd poll, unexpected missing ioctl for anon memory
> >>   # echo $?
> >>   1
> >>
> >> Change userfaultfd_zeropage_test() to return KSFT_SKIP to indicate that
> >> the test is being skipped.
> >
> > I took a deeper look at what userfaultfd_zeropage_test() does and,
> > apparently, I've mislead you. The test checks if the range has
> > UFFDIO_ZEROPAGE and verifies that it works if yes; otherwise the test
> > verifies that EINVAL is returned.
> >
> > Can you please check if the patch below works in your environment?
> >
> > From 7a34c84c0461b5073742275638c44b6535d19166 Mon Sep 17 00:00:00 2001
> > From: Mike Rapoport <rppt at linux.vnet.ibm.com>
> > Date: Tue, 7 Aug 2018 09:44:19 +0300
> > Subject: [PATCH] userfaultfd: selftest: make supported range ioctl
> >  verification more robust
> >
> > When userfaultfd tests runs on older kernel that does not support
> > UFFDIO_ZEROPAGE for shared memory it fails at the ioctl verification.
> >
> > Split out the verification that supported ioctls are superset of the
> > expected ioctls and relax the checks for UFFDIO_ZEROPAGE for shared memory
> > areas.
> >
> > Signed-off-by: Mike Rapoport <rppt at linux.vnet.ibm.com>
> > ---
> >  tools/testing/selftests/vm/userfaultfd.c | 63 +++++++++++++++++---------------
> >  1 file changed, 34 insertions(+), 29 deletions(-)
> 
> I'm sorry to take this long to respond, I was only able to get back to
> this today.

No problem :)

> Your patch does solve my problem. Thank you very much!
> 
> It has a trivial conflict in the second hunk with patch 3 in my series.
> Should I repost the series with your patch in place of patch 4?

Yep.
 
> --
> Thiago Jung Bauermann
> IBM Linux Technology Center

-- 
Sincerely yours,
Mike.

WARNING: multiple messages have this Message-ID (diff)
From: Mike Rapoport <rppt@linux.vnet.ibm.com>
To: Thiago Jung Bauermann <bauerman@linux.ibm.com>
Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
	Shuah Khan <shuah@kernel.org>,
	Andrea Arcangeli <aarcange@redhat.com>,
	Prakash Sangappa <prakash.sangappa@oracle.com>
Subject: Re: [PATCH v2 4/4] userfaultfd: selftest: Cope if shmem doesn't support zeropage
Date: Tue, 28 Aug 2018 09:15:11 +0300	[thread overview]
Message-ID: <20180828061510.GA25317@rapoport-lnx> (raw)
In-Reply-To: <87zhx7rywm.fsf@morokweng.localdomain>

On Mon, Aug 27, 2018 at 11:46:33PM -0300, Thiago Jung Bauermann wrote:
> 
> Hello Mike,
> 
> Mike Rapoport <rppt@linux.vnet.ibm.com> writes:
> 
> > Hi,
> >
> > On Fri, Aug 03, 2018 at 07:00:46PM -0300, Thiago Jung Bauermann wrote:
> >> If userfaultfd runs on a system that doesn't support UFFDIO_ZEROPAGE for
> >> shared memory, it currently ends with error code 1 which indicates test
> >> failure:
> >>
> >>   # ./userfaultfd shmem 10 10
> >>   nr_pages: 160, nr_pages_per_cpu: 80
> >>   bounces: 9, mode: rnd poll, unexpected missing ioctl for anon memory
> >>   # echo $?
> >>   1
> >>
> >> Change userfaultfd_zeropage_test() to return KSFT_SKIP to indicate that
> >> the test is being skipped.
> >
> > I took a deeper look at what userfaultfd_zeropage_test() does and,
> > apparently, I've mislead you. The test checks if the range has
> > UFFDIO_ZEROPAGE and verifies that it works if yes; otherwise the test
> > verifies that EINVAL is returned.
> >
> > Can you please check if the patch below works in your environment?
> >
> > From 7a34c84c0461b5073742275638c44b6535d19166 Mon Sep 17 00:00:00 2001
> > From: Mike Rapoport <rppt@linux.vnet.ibm.com>
> > Date: Tue, 7 Aug 2018 09:44:19 +0300
> > Subject: [PATCH] userfaultfd: selftest: make supported range ioctl
> >  verification more robust
> >
> > When userfaultfd tests runs on older kernel that does not support
> > UFFDIO_ZEROPAGE for shared memory it fails at the ioctl verification.
> >
> > Split out the verification that supported ioctls are superset of the
> > expected ioctls and relax the checks for UFFDIO_ZEROPAGE for shared memory
> > areas.
> >
> > Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
> > ---
> >  tools/testing/selftests/vm/userfaultfd.c | 63 +++++++++++++++++---------------
> >  1 file changed, 34 insertions(+), 29 deletions(-)
> 
> I'm sorry to take this long to respond, I was only able to get back to
> this today.

No problem :)

> Your patch does solve my problem. Thank you very much!
> 
> It has a trivial conflict in the second hunk with patch 3 in my series.
> Should I repost the series with your patch in place of patch 4?

Yep.
 
> --
> Thiago Jung Bauermann
> IBM Linux Technology Center

-- 
Sincerely yours,
Mike.


  reply	other threads:[~2018-08-28  6:15 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-03 22:00 [PATCH v2 0/4] userfaultfd: selftest: Improve behavior with older kernels bauerman
2018-08-03 22:00 ` Thiago Jung Bauermann
2018-08-03 22:00 ` Thiago Jung Bauermann
2018-08-03 22:00 ` [PATCH v2 1/4] userfaultfd: selftest: Fix checking of userfaultfd_open() result bauerman
2018-08-03 22:00   ` Thiago Jung Bauermann
2018-08-03 22:00   ` Thiago Jung Bauermann
2018-08-07  6:50   ` rppt
2018-08-07  6:50     ` Mike Rapoport
2018-08-07  6:50     ` Mike Rapoport
2018-08-03 22:00 ` [PATCH v2 2/4] userfaultfd: selftest: Skip test if userfaultfd() syscall not supported bauerman
2018-08-03 22:00   ` Thiago Jung Bauermann
2018-08-03 22:00   ` Thiago Jung Bauermann
2018-08-07  6:50   ` rppt
2018-08-07  6:50     ` Mike Rapoport
2018-08-07  6:50     ` Mike Rapoport
2018-08-03 22:00 ` [PATCH v2 3/4] userfaultfd: selftest: Skip test if a feature isn't supported bauerman
2018-08-03 22:00   ` Thiago Jung Bauermann
2018-08-03 22:00   ` Thiago Jung Bauermann
2018-08-07  6:51   ` rppt
2018-08-07  6:51     ` Mike Rapoport
2018-08-07  6:51     ` Mike Rapoport
2018-08-03 22:00 ` [PATCH v2 4/4] userfaultfd: selftest: Cope if shmem doesn't support zeropage bauerman
2018-08-03 22:00   ` Thiago Jung Bauermann
2018-08-03 22:00   ` Thiago Jung Bauermann
2018-08-07  6:56   ` rppt
2018-08-07  6:56     ` Mike Rapoport
2018-08-07  6:56     ` Mike Rapoport
2018-08-28  2:46     ` bauerman
2018-08-28  2:46       ` Thiago Jung Bauermann
2018-08-28  2:46       ` Thiago Jung Bauermann
2018-08-28  6:15       ` rppt [this message]
2018-08-28  6:15         ` Mike Rapoport
2018-08-28  6:15         ` Mike Rapoport

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=20180828061510.GA25317@rapoport-lnx \
    --to=unknown@example.com \
    /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.