From: David Hildenbrand <david@redhat.com>
To: kernel test robot <oliver.sang@intel.com>
Cc: oe-lkp@lists.linux.dev, lkp@intel.com,
Linux Memory Management List <linux-mm@kvack.org>,
Andrew Morton <akpm@linux-foundation.org>,
Alexander Gordeev <agordeev@linux.ibm.com>,
Christian Borntraeger <borntraeger@linux.ibm.com>,
Claudio Imbrenda <imbrenda@linux.ibm.com>,
Gerald Schaefer <gerald.schaefer@linux.ibm.com>,
Heiko Carstens <hca@linux.ibm.com>,
Janosch Frank <frankja@linux.ibm.com>,
Jonathan Corbet <corbet@lwn.net>,
Matthew Wilcox <willy@infradead.org>,
Sven Schnelle <svens@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Ryan Roberts <ryan.roberts@arm.com>, Zi Yan <ziy@nvidia.com>,
ltp@lists.linux.it,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Subject: Re: [linux-next:master] [mm/migrate] b28dd7507f: ltp.move_pages04.fail
Date: Wed, 21 Aug 2024 10:44:32 +0200 [thread overview]
Message-ID: <767d1908-dc30-42ae-9a8a-d2ad42a4d491@redhat.com> (raw)
In-Reply-To: <202408211026.636ade1a-oliver.sang@intel.com>
On 21.08.24 06:44, kernel test robot wrote:
>
>
> Hello,
>
> kernel test robot noticed "ltp.move_pages04.fail" on:
>
> commit: b28dd7507f2dd7923325eab6ea1f291416dcc396 ("mm/migrate: convert add_page_for_migration() from follow_page() to folio_walk")
> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git master
>
> [test failed on linux-next/master bb1b0acdcd66e0d8eedee3570d249e076b89ab32]
>
> in testcase: ltp
> version: ltp-x86_64-14c1f76-1_20240817
> with following parameters:
>
> test: numa/move_pages04
>
>
>
> compiler: gcc-12
> test machine: 224 threads 2 sockets Intel(R) Xeon(R) Platinum 8480+ (Sapphire Rapids) with 256G 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/202408211026.636ade1a-oliver.sang@intel.com
>
>
>
> Running tests.......
> <<<test_start>>>
> tag=move_pages04 stime=1724192393
> cmdline="move_pages04"
> contacts=""
> analysis=exit
> <<<test_output>>>
> move_pages04 1 TFAIL : move_pages04.c:142: status[1] is ENOENT, expected EFAULT
This change is to be expected, and I touched on that in the patch
description. I am rather surprised that we have a test for that
handling, especially because it changed already (see below).
The man page says:
-EFAULT: This is a zero page or the memory area is not mapped
by the process.
"memory area not mapped" to me translates to "there is no mmap()", not
"there is no page mapped". And it says:
-ENOENT: The page is not present.
It's not really specifies what happens when "The memory area is mapped
by the process, but no page is faulted in.".
And the old handling was even inconsistent: to achieve the old behavior,
we abused FOLL_DUMP, which triggers in mm/gup.c:no_page_table():
(1) is_vm_hugetlb_page() *and* a hugetlb page is in the pagecache?
Return -EFAULT. Otherwise return NULL -> -ENOENT.
(2) vma_is_anonymous() || !vma->vm_ops->fault ? Return -EFAULT.
Otherwise return NULL -> -ENOENT.
So, if nothing is mapped, for things like shmem we would always return
"-ENOENT", for anonymous memory always "-EFAULT", and for hugetlb
"-ENOENT" or "-EFAULT", depending on the page cache state. Inconsistent,
and that handling is only in place because we abused FOLL_DUMP.
(there are other issues in the old implementation: on PMD migration
entries we would likely have returned -EFAULT in some cases where we
should have returned -ENOENT ...)
While writing folio_walk, I temporarily had a version that would return
error codes instead of NULL to indicate "there is something, but we
cannot return it" and "there is nothing", but it didn't feel right. And
I'm not really interested in revisiting that :)
----
Staring at the test, I realized the that behavior *changed* already,
because we wanted to fix the "zero page" and started abusing FOLL_DUMP,
but ended up changing the behavior for unpopulated (nothing mapped)
memory as well:
* NAME
* move_pages04.c
*
* DESCRIPTION
* Failure when page does not exit.
*
* ALGORITHM
*
* 1. Pass zero page (allocated, but not written to) as one of the
* page addresses to move_pages().
* 2. Check if the corresponding status is set to:
* -ENOENT for kernels < 4.3
* -EFAULT for kernels >= 4.3 [1]
*
* [1]
* d899844e9c98 "mm: fix status code which move_pages() returns for
zero page"
*
Likely test is *wrong*, because it claims to test the "zero page" but it
just passes "unpopulated" memory.
Let me dig deeper into the test.
--
Cheers,
David / dhildenb
next prev parent reply other threads:[~2024-08-21 8:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-21 4:44 [linux-next:master] [mm/migrate] b28dd7507f: ltp.move_pages04.fail kernel test robot
2024-08-21 8:44 ` David Hildenbrand [this message]
2024-08-21 9:15 ` David Hildenbrand
2024-08-28 10:37 ` [LTP] " Cyril Hrubis
2024-08-28 10:51 ` David Hildenbrand
2024-08-28 12:23 ` Cyril Hrubis
2024-08-28 12:28 ` David Hildenbrand
2024-08-28 12:30 ` Cyril Hrubis
2024-08-29 13:49 ` David Hildenbrand
2024-08-29 14:31 ` Cyril Hrubis
2024-08-29 14:38 ` David Hildenbrand
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=767d1908-dc30-42ae-9a8a-d2ad42a4d491@redhat.com \
--to=david@redhat.com \
--cc=agordeev@linux.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=borntraeger@linux.ibm.com \
--cc=corbet@lwn.net \
--cc=frankja@linux.ibm.com \
--cc=gerald.schaefer@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=imbrenda@linux.ibm.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
--cc=ltp@lists.linux.it \
--cc=oe-lkp@lists.linux.dev \
--cc=oliver.sang@intel.com \
--cc=ryan.roberts@arm.com \
--cc=svens@linux.ibm.com \
--cc=willy@infradead.org \
--cc=ziy@nvidia.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).