linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: wang lian <lianux.mm@gmail.com>
To: lorenzo.stoakes@oracle.com
Cc: Liam.Howlett@oracle.com, akpm@linux-foundation.org,
	brauner@kernel.org, broonie@kernel.org, david@redhat.com,
	gkwang@linx-info.com, jannh@google.com, lianux.mm@gmail.com,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-mm@kvack.org, p1ucky0923@gmail.com, ryncsn@gmail.com,
	shuah@kernel.org, sj@kernel.org, vbabka@suse.cz,
	zijing.zhang@proton.me, ziy@nvidia.com
Subject: Re: [PATCH v3] selftests/mm: add process_madvise() tests
Date: Fri, 11 Jul 2025 20:09:38 +0800	[thread overview]
Message-ID: <20250711120938.15270-1-lianux.mm@gmail.com> (raw)
In-Reply-To: <e05e7e0d-02e3-435c-bb82-91200a868448@lucifer.local>

Hi Lorenzo Stoakes,

> On Fri, Jul 11, 2025 at 09:34:38AM +0100, Mark Brown wrote:
> > On Thu, Jul 10, 2025 at 12:28:13PM -0400, Zi Yan wrote:
> > > On 10 Jul 2025, at 4:42, Mark Brown wrote:
> > > > On Wed, Jul 09, 2025 at 10:46:07AM -0400, Zi Yan wrote:
> > > >
> > > > > Right. My /usr/include/sys does not have pidfd.h. IMHO selftests
> > > > > should not rely on userspace headers, otherwise we cannot test
> > > > > latest kernel changes.
> > > >
> > > > That's not realistic, we need to be able to use things like libc and for
> > > > many areas you'd just end up copying or reimplmenenting the userspace
> > > > libraries.  There's some concerns for sure, for example we used to have
> > >
> > > Sure. For libraries like libc, it is unrealistic to not rely on it.
> > > But for header files, are we expecting to install any kernel headers
> > > to the running system to get selftests compiled? If we are testing
> > > RC versions and header files might change before the actual release,
> > > that would pollute the system header files, right?
> >
> > Right, for the kernel's headers there's two things - we use a
> > combination of tools/include and 'make headers_install' which populates
> > usr/include in the kernel tree (apparently mm rejects the latter but it
> > is widely used in the selftests, especially for architecture specifics).
> > These install locally and used before the system headers.
> >
> > > > OTOH in a case like this where we can just refer directly to a kernel
> > > > header for some constants or structs then it does make sense to use the
> > > > kernel headers, or in other cases where we're testing things that are
> >
> > > That is exactly my point above.
> >
> > What was said was a bit stronger though, and might lead people down a
> > wheel reinvention path.
>
> Let's PLEASE not rehash all this again...
>
> This patch literally just needs PIDFD_SELF, I've provided a couple of ways
> of doing that without introducing this requirement.
>
> We already have a test that uses this with no problems ever reported on
> which this patch was based.
>
> Thanks.

You are absolutely right, and my apologies for introducing this
unnecessary header dependency.

Just to clarify, the build failure Zi Yan reported on arm64 was not
caused by PIDFD_SELF. It was from my use of the pidfd_open() glibc
wrapper in the test, which incorrectly pulled in the system's
<sys/pidfd.h>.

Based on our discussion and a review of other tests, I understand the
correct approach is to avoid such dependencies. I will fix this properly
in the next version by using a direct syscall wrapper for pidfd_open.
Thank you for the guidance.

Best regards,
Wang Lian


  reply	other threads:[~2025-07-11 12:09 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-03  4:43 wang lian
2025-07-05 19:32 ` Lorenzo Stoakes
2025-07-06  6:07   ` [PATCH v3] selftests/vm: Add tests for process_madvise() 王炼
2025-07-08 17:44 ` [PATCH v3] selftests/mm: add process_madvise() tests Zi Yan
2025-07-09 12:32   ` wang lian
2025-07-09 12:51     ` Lorenzo Stoakes
2025-07-10 11:29       ` wang lian
2025-07-09 14:46     ` Zi Yan
2025-07-10  8:42       ` Mark Brown
2025-07-10 16:28         ` Zi Yan
2025-07-11  8:34           ` Mark Brown
2025-07-11  8:49             ` Lorenzo Stoakes
2025-07-11 12:09               ` wang lian [this message]
2025-07-10 11:40       ` wang lian
2025-07-10 13:42 [PATCH v4] " Mark Brown
2025-07-11 12:19 ` [PATCH v3] " wang lian

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=20250711120938.15270-1-lianux.mm@gmail.com \
    --to=lianux.mm@gmail.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=brauner@kernel.org \
    --cc=broonie@kernel.org \
    --cc=david@redhat.com \
    --cc=gkwang@linx-info.com \
    --cc=jannh@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=p1ucky0923@gmail.com \
    --cc=ryncsn@gmail.com \
    --cc=shuah@kernel.org \
    --cc=sj@kernel.org \
    --cc=vbabka@suse.cz \
    --cc=zijing.zhang@proton.me \
    --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