linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
To: John Hubbard <jhubbard@nvidia.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>,
	Christian Brauner <christian@brauner.io>,
	Shuah Khan <shuah@kernel.org>,
	"Liam R . Howlett" <Liam.Howlett@oracle.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Vlastimil Babka <vbabka@suse.cz>,
	pedro.falcato@gmail.com, linux-kselftest@vger.kernel.org,
	linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
	linux-api@vger.kernel.org, linux-kernel@vger.kernel.org,
	Oliver Sang <oliver.sang@intel.com>
Subject: Re: [PATCH v3 3/3] selftests: pidfd: add tests for PIDFD_SELF_*
Date: Thu, 17 Oct 2024 18:28:16 +0100	[thread overview]
Message-ID: <28184c3d-3c88-4f8a-a25d-7b5268b55c93@lucifer.local> (raw)
In-Reply-To: <97b6a4ea-d53a-47f1-8e64-5b9558f194c1@nvidia.com>

On Thu, Oct 17, 2024 at 10:17:54AM -0700, John Hubbard wrote:
> On 10/17/24 5:06 AM, Lorenzo Stoakes wrote:
> > +cc John, sorry I forgot to cc you on other replies!!
> >
> > On Thu, Oct 17, 2024 at 09:08:19AM +0100, Lorenzo Stoakes wrote:
> > [snip]
> > >
> > > In any case I think copying the header to the tools/ directory with this
> > > linux/fcntl.h in some way stubbed out (we could even stub out fcntl.h
> > > there?) is the sensible way forward.
> > >
> > > A 'just include the header' is simply not an option as it breaks the tests.
>
> I should have read this one first, this morning, but I missed it initially.
> :)

No worries easily done! :)

>
> >
> > Ohhh ok I think maybe we could have a good compromise that should (hopefully!)
> > satisfy both you and John.
> >
> > I can introduce tools/include/linux/pidfd.h that is a stub wrapper around
> > the pidfd.h file.
> >
> > So it can be something like:
> >
> >
> > 	#ifndef __TOOLS_LINUX_PIDFD_H
> > 	#define __TOOLS_LINUX_PIDFD_H
> >
> > 	/*
> > 	 * Some systems have issues with the linux/fcntl.h import in linux/pidfd.h, so
> > 	 * work around this by setting the header guard.
> > 	 */
> > 	#define _LINUX_FCNTL_H
> > 	#include "../../../include/uapi/linux/pidfd.h"
> > 	#undef _LINUX_FCNTL_H
> >
> > 	#endif /* __TOOLS_LINUX_PIDFD_H */
> >
> >
> > Then the test code needs only to update the pidfd.h file to #include
> > <linux/pidfd.h> and add a simple $(TOOLS_INCLUDES) to the CFLAGS += line in
> > the pidfd self tests Makefile and we should be all good.
>
> Yes.
>
> >
> > That way we always import everything in this header correctly, we directly
> > document this issue, we include the header as you would in userland and we
> > should cover off all the issues?
>
> Very nice!

Thanks!

I saw from your other thread the idea was to take snapshots and to run scripts
to compare etc. but I suppose putting this into the known-stub directory
tools/include/linux rather than tools/include/uapi/linux would avoid a conflict
here.

Or would you say the wrapper should regardless be in the uapi/linux directory?

Thanks!

>
>
> thanks,
> --
> John Hubbard
>


  reply	other threads:[~2024-10-17 17:28 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-16 10:20 [PATCH v3 0/3] introduce PIDFD_SELF* sentinels Lorenzo Stoakes
2024-10-16 10:20 ` [PATCH v3 1/3] pidfd: extend pidfd_get_pid() and de-duplicate pid lookup Lorenzo Stoakes
2024-10-16 10:20 ` [PATCH v3 2/3] pidfd: add PIDFD_SELF_* sentinels to refer to own thread/process Lorenzo Stoakes
2024-10-16 10:20 ` [PATCH v3 3/3] selftests: pidfd: add tests for PIDFD_SELF_* Lorenzo Stoakes
2024-10-16 20:00   ` Shuah Khan
2024-10-16 22:06     ` Lorenzo Stoakes
2024-10-16 22:30       ` Lorenzo Stoakes
2024-10-16 22:38       ` Shuah Khan
2024-10-17  8:08         ` Lorenzo Stoakes
2024-10-17 12:06           ` Lorenzo Stoakes
2024-10-17 17:17             ` John Hubbard
2024-10-17 17:28               ` Lorenzo Stoakes [this message]
2024-10-17 17:37                 ` John Hubbard
2024-10-17 17:38                   ` Lorenzo Stoakes
2024-10-17 19:37                     ` Shuah Khan
2024-10-17 19:40                       ` Lorenzo Stoakes
2024-10-17  2:14       ` John Hubbard
2024-10-17  7:54         ` Lorenzo Stoakes
2025-05-01 11:42         ` Peter Zijlstra
2025-05-01 12:46           ` Peter Zijlstra
2025-05-01 19:50             ` Sean Christopherson
2025-05-05 13:35             ` Christian Brauner
2025-05-06  9:28               ` Lorenzo Stoakes
2025-05-06 21:18           ` Shuah Khan
2025-05-06 21:34             ` John Hubbard
2025-05-07 20:49               ` Shuah Khan
2024-10-17  2:01     ` The "make headers" requirement, revisited: " John Hubbard
2024-10-17 16:33       ` Shuah Khan
2024-10-17 16:47         ` John Hubbard
2025-05-07 20:50           ` Shuah Khan
2025-05-08 14:04             ` Sean Christopherson
2025-05-08 15:06               ` Shuah Khan

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=28184c3d-3c88-4f8a-a25d-7b5268b55c93@lucifer.local \
    --to=lorenzo.stoakes@oracle.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=christian@brauner.io \
    --cc=jhubbard@nvidia.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=oliver.sang@intel.com \
    --cc=pedro.falcato@gmail.com \
    --cc=shuah@kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=surenb@google.com \
    --cc=vbabka@suse.cz \
    /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