* Re: [linux-next:master] [mm/vma] 6898c9039b: ltp.memfd_create03.fail
2024-09-08 13:15 [linux-next:master] [mm/vma] 6898c9039b: ltp.memfd_create03.fail kernel test robot
@ 2024-09-08 13:51 ` Lorenzo Stoakes
0 siblings, 0 replies; 2+ messages in thread
From: Lorenzo Stoakes @ 2024-09-08 13:51 UTC (permalink / raw)
To: kernel test robot
Cc: Liam R. Howlett, oe-lkp, lkp, Linux Memory Management List,
Andrew Morton, Bert Karwatzki, Jeff Xu, Jiri Olsa, Kees Cook,
Lorenzo Stoakes, Mark Brown, Matthew Wilcox, Paul E. McKenney,
Paul Moore, Sidhartha Kumar, Suren Baghdasaryan, Vlastimil Babka,
ltp
On Sun, Sep 08, 2024 at 09:15:45PM GMT, kernel test robot wrote:
>
>
> Hello,
>
> kernel test robot noticed "ltp.memfd_create03.fail" on:
Hi,
Thanks for the report.
This looks _probably_ to be a problem in the test rather than the kernel.
An munmap() is failing (as expected by the test) to unmap invalid sizes
from a hugetlb allocation.
It expects EINVAL:
if (errno == EINVAL) {
tst_res(TINFO,
"munmap(%p, %dkB) failed as expected",
mem, i/1024);
But is instead receiving ENOMEM.
This is because we rearrange how we perform unmaps.
In both cases we are failing when we go ahead and attempt a split via
__split_vma(), which invokes vm_ops->may_split() which is equal to
hugetlb_vm_op_split() which returns EINVAL.
The difference is that original implementation, in do_vmi_align_munmap() we
do:
error = __split_vma(vmi, vma, start, 1);
if (error)
goto start_split_failed;
Which forwards the EINVAL.
Now in vms_gather_munmap_vmas(), we do:
int error = -ENOMEM;
...
if (__split_vma(vms->vmi, vms->vma, vms->start, 1))
goto start_split_failed;
So we filter the error code to ENOMEM.
Liam - could you confirm if this needs an actual change in the kernel? If
not the test should be changed.
Test fix is obviously as simple as:
if (errno == EINVAL || error == ENOMEM) {
...
Cheers, Lorenzo
>
> commit: 6898c9039bc8e3027ae0fcd0f05fc2b82ccc8be0 ("mm/vma: extract the gathering of vmas from do_vmi_align_munmap()")
> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git master
>
> [test failed on linux-next/master 9aaeb87ce1e966169a57f53a02ba05b30880ffb8]
>
> in testcase: ltp
> version: ltp-x86_64-14c1f76-1_20240831
> with following parameters:
>
> disk: 1HDD
> fs: btrfs
> test: syscalls-03/memfd_create03
>
>
>
> compiler: gcc-12
> test machine: 4 threads 1 sockets Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz (Ivy Bridge) with 8G memory
>
> (please refer to attached dmesg/kmsg for entire log/backtrace)
>
>
>
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <oliver.sang@intel.com>
> | Closes: https://lore.kernel.org/oe-lkp/202409081536.d283a0fb-oliver.sang@intel.com
>
>
>
> Running tests.......
> <<<test_start>>>
> tag=memfd_create03 stime=1725647495
> cmdline="memfd_create03"
> contacts=""
> analysis=exit
> <<<test_output>>>
> tst_hugepage.c:84: TINFO: 1 hugepage(s) reserved
> tst_test.c:1809: TINFO: LTP version: 20240524-209-g9a6f3896f
> tst_test.c:1813: TINFO: Tested kernel: 6.11.0-rc6-00249-g6898c9039bc8 #1 SMP PREEMPT_DYNAMIC Thu Sep 5 20:53:00 CST 2024 x86_64
> tst_test.c:1652: TINFO: Timeout per run is 0h 02m 30s
> memfd_create03.c:171: TINFO: --TESTING WRITE CALL IN HUGEPAGES--
> memfd_create03.c:176: TINFO: memfd_create() succeeded
> memfd_create03.c:70: TPASS: write(4, "LTP", 3) failed as expected
>
> memfd_create03.c:171: TINFO: --TESTING PAGE SIZE OF CREATED FILE--
> memfd_create03.c:176: TINFO: memfd_create() succeeded
> memfd_create03.c:43: TINFO: mmap((nil), 2097152, 2, 2, 4, 0) succeeded
> memfd_create03.c:96: TFAIL: munmap(0x7f9b26c00000, 512kB) failed unexpectedly: ENOMEM (12)
> memfd_create03.c:171: TINFO: --TESTING HUGEPAGE ALLOCATION LIMIT--
> memfd_create03.c:176: TINFO: memfd_create() succeeded
> memfd_create03.c:39: TBROK: mmap((nil),0,PROT_WRITE(2),2,4,0) failed: EINVAL (22)
>
> Summary:
> passed 1
> failed 1
> broken 1
> skipped 0
> warnings 0
> incrementing stop
> <<<execution_status>>>
> initiation_status="ok"
> duration=2 termination_type=exited termination_id=3 corefile=no
> cutime=0 cstime=187
> <<<test_end>>>
> INFO: ltp-pan reported some tests FAIL
> LTP Version: 20240524-209-g9a6f3896f
>
> ###############################################################
>
> Done executing testcases.
> LTP Version: 20240524-209-g9a6f3896f
> ###############################################################
>
> -------------------------------------------
> INFO: runltp script is deprecated, try kirk
> https://github.com/linux-test-project/kirk
> -------------------------------------------
>
>
>
> The kernel config and materials to reproduce are available at:
> https://download.01.org/0day-ci/archive/20240908/202409081536.d283a0fb-oliver.sang@intel.com
>
>
>
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki
>
^ permalink raw reply [flat|nested] 2+ messages in thread