Re: [PATCH v2 4/4] userfaultfd: selftest: Cope if shmem doesn't support zeropage

From: Mike Rapoport
Date: Tue Aug 07 2018 - 02:56:55 EST


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?