From: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
To: kernel test robot <oliver.sang@intel.com>
Cc: "Liam R. Howlett" <Liam.Howlett@oracle.com>,
oe-lkp@lists.linux.dev, lkp@intel.com,
Linux Memory Management List <linux-mm@kvack.org>,
Andrew Morton <akpm@linux-foundation.org>,
Bert Karwatzki <spasswolf@web.de>, Jeff Xu <jeffxu@chromium.org>,
Jiri Olsa <olsajiri@gmail.com>, Kees Cook <kees@kernel.org>,
Lorenzo Stoakes <lstoakes@gmail.com>,
Mark Brown <broonie@kernel.org>,
Matthew Wilcox <willy@infradead.org>,
"Paul E. McKenney" <paulmck@kernel.org>,
Paul Moore <paul@paul-moore.com>,
Sidhartha Kumar <sidhartha.kumar@oracle.com>,
Suren Baghdasaryan <surenb@google.com>,
Vlastimil Babka <vbabka@suse.cz>,
ltp@lists.linux.it
Subject: Re: [linux-next:master] [mm/vma] 6898c9039b: ltp.memfd_create03.fail
Date: Sun, 8 Sep 2024 14:51:04 +0100 [thread overview]
Message-ID: <97fa18b0-51d7-4c7e-9d86-54def7aa1478@lucifer.local> (raw)
In-Reply-To: <202409081536.d283a0fb-oliver.sang@intel.com>
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
>
prev parent reply other threads:[~2024-09-08 13:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-08 13:15 kernel test robot
2024-09-08 13:51 ` Lorenzo Stoakes [this message]
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=97fa18b0-51d7-4c7e-9d86-54def7aa1478@lucifer.local \
--to=lorenzo.stoakes@oracle.com \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=broonie@kernel.org \
--cc=jeffxu@chromium.org \
--cc=kees@kernel.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
--cc=lstoakes@gmail.com \
--cc=ltp@lists.linux.it \
--cc=oe-lkp@lists.linux.dev \
--cc=oliver.sang@intel.com \
--cc=olsajiri@gmail.com \
--cc=paul@paul-moore.com \
--cc=paulmck@kernel.org \
--cc=sidhartha.kumar@oracle.com \
--cc=spasswolf@web.de \
--cc=surenb@google.com \
--cc=vbabka@suse.cz \
--cc=willy@infradead.org \
/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