On Thu, Jan 30, 2025 at 03:32:36PM -0800, Andrew Morton wrote:
> On Thu, 30 Jan 2025 23:10:53 + Pedro Falcato
> wrote:
>
> > On Thu, Jan 30, 2025 at 10:53 PM Lorenzo Stoakes
> > wrote:
> > >
> > > > The above code sequence doesn't seem at all o
On Thu, Jan 30, 2025 at 02:37:54PM -0800, Andrew Morton wrote:
> On Thu, 30 Jan 2025 20:40:25 +0000 Lorenzo Stoakes
> wrote:
>
> > If you wish to utilise a pidfd interface to refer to the current process or
> > thread it is rather cumbersome, requiring something like:
considers to be a process.
We adjust pidfd_get_task() and the pidfd_send_signal() system call with
specific handling for this, implementing this functionality for
process_madvise(), process_mrelease() (albeit, using it here wouldn't
really make sense) and pidfd_send_signal().
Signed-off-by:
Now we have PIDFD_SELF available for process_madvise(), make use of it in
the guard pages test.
This is both more convenient and asserts that PIDFD_SELF works as expected.
Signed-off-by: Lorenzo Stoakes
---
tools/testing/selftests/mm/Makefile | 4
tools/testing/selftests/mm/guard
sensibly tested as it would require the testing process to be dying).
We also correct the pidfd_open_test.c fields which refer to .request_mask
whereas the UAPI header refers to .mask, which otherwise break the import
of the UAPI header.
Signed-off-by: Lorenzo Stoakes
---
tools/testing
-by: Shuah Khan
Signed-off-by: Lorenzo Stoakes
---
tools/include/linux/pidfd.h| 14 ++
tools/testing/selftests/pidfd/Makefile | 3 +--
2 files changed, 15 insertions(+), 2 deletions(-)
create mode 100644 tools/include/linux/pidfd.h
diff --git a/tools/include/linux
kernel.org/linux-mm/cover.1728578231.git.lorenzo.stoa...@oracle.com/
RFC version:
https://lore.kernel.org/linux-mm/cover.1727644404.git.lorenzo.stoa...@oracle.com/
Lorenzo Stoakes (6):
pidfd: add PIDFD_SELF* sentinels to refer to own thread/process
selftests/pidfd: add missing system heade
It seems tests other than the pidfd tests use the wait_for_pid() function
declared in pidfd.h.
Since we will shortly be modifying pidfd.h in a way that might clash with
other tests, separate this out and update tests accordingly.
Signed-off-by: Lorenzo Stoakes
---
tools/testing/selftests
The pidfd_fdinfo_test.c and pidfd_setns_test.c tests appear to be missing
fundamental system header imports required to execute correctly. Add these.
Signed-off-by: Lorenzo Stoakes
---
tools/testing/selftests/pidfd/pidfd_fdinfo_test.c | 1 +
tools/testing/selftests/pidfd/pidfd_setns_test.c | 1
On Wed, Jan 15, 2025 at 12:21:15PM -0500, Peter Xu wrote:
> On Wed, Jan 15, 2025 at 04:58:06PM +, Ryan Roberts wrote:
> > Hi Peter, David,
>
> Hey, Ryan,
>
> >
> > On 07/01/2025 14:47, Ryan Roberts wrote:
> > > When mremap()ing a memory region previously registered with userfaultfd
> > > as wri
On Tue, Jan 14, 2025 at 11:21:15AM +0800, liuye wrote:
> If name is NULL, a NULL pointer may be accessed in printf.
>
> Signed-off-by: liuye
Reviewed-by: Lorenzo Stoakes
> ---
> tools/testing/selftests/memfd/memfd_test.c | 2 +-
> 1 file changed, 1 insertion(+), 1 de
On Thu, Jan 02, 2025 at 03:32:51PM -0800, Isaac J. Manjarres wrote:
> Add tests to ensure that F_SEAL_FUTURE_EXEC behaves as expected.
>
> Signed-off-by: Isaac J. Manjarres
This looks reasonable,
Reviewed-by: Lorenzo Stoakes
> ---
> tools/testing/selftests/memfd/me
On Wed, Jan 08, 2025 at 08:43:38PM +, Lorenzo Stoakes wrote:
> On Mon, Jan 06, 2025 at 05:14:26PM -0800, Isaac Manjarres wrote:
> > On Fri, Jan 03, 2025 at 04:03:44PM +0100, Jann Horn wrote:
> > > On Fri, Jan 3, 2025 at 12:32 AM Isaac J. Manjarres
> > > wrote:
>
On Thu, Jan 02, 2025 at 03:32:50PM -0800, Isaac J. Manjarres wrote:
> Android currently uses the ashmem driver [1] for creating shared memory
> regions between processes. Ashmem buffers can initially be mapped with
> PROT_READ, PROT_WRITE, and PROT_EXEC. Processes can then use the
> ASHMEM_SET_PROT
On Mon, Jan 06, 2025 at 05:14:26PM -0800, Isaac Manjarres wrote:
> On Fri, Jan 03, 2025 at 04:03:44PM +0100, Jann Horn wrote:
> > On Fri, Jan 3, 2025 at 12:32 AM Isaac J. Manjarres
> > wrote:
> > > Android currently uses the ashmem driver [1] for creating shared memory
> > > regions between proces
On Thu, Jan 02, 2025 at 03:32:49PM -0800, Isaac J. Manjarres wrote:
> * Resending because I accidentally forgot to include Lorenzo in the
> "to" list.
>
> Android uses the ashmem driver [1] for creating shared memory regions
> between processes. The ashmem driver exposes an ioctl command for
> pr
On Mon, Jan 06, 2025 at 04:44:33PM -0800, Kees Cook wrote:
> On Mon, Jan 06, 2025 at 10:26:27AM -0800, Jeff Xu wrote:
> > + Kees because this is related to W^X memfd and security.
> >
> > On Fri, Jan 3, 2025 at 7:14 AM Jann Horn wrote:
> > >
> > > On Fri,
On Mon, Jan 06, 2025 at 01:03:31PM -0800, Shakeel Butt wrote:
> Hey Lorenzo & Christian, what's the latest here? I see Christian has
> code suggestions at [1] which just needs to be addressed. Any thing
> else? I am hoping we can get this merged in the coming open window.
This is on my radar don't
On Fri, Dec 06, 2024 at 12:48:09PM -0800, Isaac Manjarres wrote:
> On Fri, Dec 06, 2024 at 06:19:49PM +0000, Lorenzo Stoakes wrote:
> > On Thu, Dec 05, 2024 at 05:09:22PM -0800, Isaac J. Manjarres wrote:
> > > diff --git a/mm/mmap.c b/mm/mmap.c
> > > index b1b2a2
On Thu, Dec 05, 2024 at 05:09:22PM -0800, Isaac J. Manjarres wrote:
> Android currently uses the ashmem driver [1] for creating shared memory
> regions between processes. Ashmem buffers can initially be mapped with
> PROT_READ, PROT_WRITE, and PROT_EXEC. Processes can then use the
> ASHMEM_SET_PROT
asserts that the behaviour is
as we expect.
This is grouped with other, more important, fork tests that ensure that
guard pages are correctly propagated on fork.
Fix a typo in a nearby comment at the same time.
Signed-off-by: Lorenzo Stoakes
---
tools/testing/selftests/mm/guard-pages.c | 73
On Fri, Nov 08, 2024 at 02:28:14PM +, Lorenzo Stoakes wrote:
> On Wed, Oct 30, 2024 at 04:37:37PM +0000, Lorenzo Stoakes wrote:
> > On Mon, Oct 28, 2024 at 04:06:07PM +, Lorenzo Stoakes wrote:
> > > I guess I'll try to adapt that and respin a v7 when I get a chance
On Wed, Oct 30, 2024 at 04:37:37PM +, Lorenzo Stoakes wrote:
> On Mon, Oct 28, 2024 at 04:06:07PM +0000, Lorenzo Stoakes wrote:
> > I guess I'll try to adapt that and respin a v7 when I get a chance.
>
> Hm looking at this draft patch, it seems like a total rework of pidfd&
On Mon, Oct 28, 2024 at 04:06:07PM +, Lorenzo Stoakes wrote:
> I guess I'll try to adapt that and respin a v7 when I get a chance.
Hm looking at this draft patch, it seems like a total rework of pidfd's
across the board right (now all pidfd's will need to be converted to
p
that set errno.
> Standardise on using the ksft_perror() helper in these cases so that more
> information is available should the tests fail.
>
> Signed-off-by: Mark Brown
Thanks very much for this! LGTM!
Acked-by: Lorenzo Stoakes
> ---
> tools/testing/selftests/arm64/mte/mte_common_util
On Mon, Oct 28, 2024 at 04:34:33PM +0100, Christian Brauner wrote:
> On Sat, Oct 26, 2024 at 08:24:58AM +0100, Lorenzo Stoakes wrote:
> > It is useful to be able to utilise the pidfd mechanism to reference the
> > current thread or process (from a userland point of view - thread g
..), process_madvise(), process_mrelease(), pidfd_send_signal(), and
pidfd_getfd() system calls.
Things such as polling a pidfs and general fd operations are not supported,
this strictly provides the sentinel for APIs which explicitly accept a
pidfd.
Suggested-by: Pedro Falcato
Reviewed-by: Shak
pid lookup and to
consistently handle this in one place.
This lays the groundwork for a subsequent patch which adds a new sentinel
pidfd to explicitly reference the current process (i.e. thread group
leader) without the need for a pidfd.
Reviewed-by: Shakeel Butt
Signed-off-by: Lorenzo Stoa
ed as it would require the testing process
to be dying).
Reviewed-by: Shuah Khan
Signed-off-by: Lorenzo Stoakes
---
tools/testing/selftests/pidfd/pidfd.h | 2 +
.../selftests/pidfd/pidfd_getfd_test.c| 141 ++
.../selftests/pidfd/pidfd_setns_test.c
-by: Shuah Khan
Signed-off-by: Lorenzo Stoakes
---
tools/include/linux/pidfd.h| 14 ++
tools/testing/selftests/pidfd/Makefile | 3 +--
2 files changed, 15 insertions(+), 2 deletions(-)
create mode 100644 tools/include/linux/pidfd.h
diff --git a/tools/include/linux
It seems tests other than the pidfd tests use the wait_for_pid() function
declared in pidfd.h.
Since we will shortly be modifying pidfd.h in a way that might clash with
other tests, separate this out and update tests accordingly.
Signed-off-by: Lorenzo Stoakes
---
tools/testing/selftests
28578231.git.lorenzo.stoa...@oracle.com/
RFC version:
https://lore.kernel.org/linux-mm/cover.1727644404.git.lorenzo.stoa...@oracle.com/
Lorenzo Stoakes (5):
pidfd: extend pidfd_get_pid() and de-duplicate pid lookup
pidfd: add PIDFD_SELF_* sentinels to refer to own thread/process
tools: testing:
On Fri, Oct 25, 2024 at 01:31:49PM -0700, John Hubbard wrote:
> On 10/25/24 12:49 PM, Lorenzo Stoakes wrote:
> > On Fri, Oct 25, 2024 at 11:44:34AM -0700, John Hubbard wrote:
> > > On 10/25/24 11:38 AM, Pedro Falcato wrote:
> > > > On Fri, Oct 25, 2024 at 6:41 P
On Fri, Oct 25, 2024 at 02:51:29PM -0700, John Hubbard wrote:
> On 10/25/24 2:09 PM, Lorenzo Stoakes wrote:
> > On Fri, Oct 25, 2024 at 01:31:49PM -0700, John Hubbard wrote:
> > > On 10/25/24 12:49 PM, Lorenzo Stoakes wrote:
> > > > On Fri, Oct 25, 2024 at 11:44:
On Fri, Oct 25, 2024 at 11:44:34AM -0700, John Hubbard wrote:
> On 10/25/24 11:38 AM, Pedro Falcato wrote:
> > On Fri, Oct 25, 2024 at 6:41 PM John Hubbard wrote:
> > >
> > > On 10/25/24 5:50 AM, Pedro Falcato wrote:
> > > > On Fri, Oct 25, 2024 at
On Fri, Oct 25, 2024 at 01:50:12PM +0100, Pedro Falcato wrote:
> On Fri, Oct 25, 2024 at 10:41 AM Lorenzo Stoakes
> wrote:
> >
> > It is useful to be able to utilise the pidfd mechanism to reference the
> > current thread or process (from a userland point of view - thre
It seems tests other than the pidfd tests use the wait_for_pid() function
declared in pidfd.h.
Since we will shortly be modifying pidfd.h in a way that might clash with
other tests, separate this out and update tests accordingly.
Signed-off-by: Lorenzo Stoakes
---
tools/testing/selftests
esting accordingly.
https://lore.kernel.org/linux-mm/cover.1728578231.git.lorenzo.stoa...@oracle.com/
RFC version:
https://lore.kernel.org/linux-mm/cover.1727644404.git.lorenzo.stoa...@oracle.com/
Lorenzo Stoakes (5):
pidfd: extend pidfd_get_pid() and de-duplicate pid lookup
pidfd: add PIDFD_SELF_*
..), process_madvise(), process_mrelease(), pidfd_send_signal(), and
pidfd_getfd() system calls.
Things such as polling a pidfs and general fd operations are not supported,
this strictly provides the sentinel for APIs which explicitly accept a
pidfd.
Reviewed-by: Shakeel Butt
Signed-off-by: Lorenzo Stoak
ed as it would require the testing process
to be dying).
Reviewed-by: Shuah Khan
Signed-off-by: Lorenzo Stoakes
---
tools/testing/selftests/pidfd/pidfd.h | 2 +
.../selftests/pidfd/pidfd_getfd_test.c| 141 ++
.../selftests/pidfd/pidfd_setns_test.c
-by: Shuah Khan
Signed-off-by: Lorenzo Stoakes
---
tools/include/linux/pidfd.h| 14 ++
tools/testing/selftests/pidfd/Makefile | 3 +--
2 files changed, 15 insertions(+), 2 deletions(-)
create mode 100644 tools/include/linux/pidfd.h
diff --git a/tools/include/linux
pid lookup and to
consistently handle this in one place.
This lays the groundwork for a subsequent patch which adds a new sentinel
pidfd to explicitly reference the current process (i.e. thread group
leader) without the need for a pidfd.
Reviewed-by: Shakeel Butt
Signed-off-by: Lorenzo Stoa
D_SELF_*")
> url:
> https://github.com/intel-lab-lkp/linux/commits/Lorenzo-Stoakes/pidfd-extend-pidfd_get_pid-and-de-duplicate-pid-lookup/20241018-050825
Thanks.
This issue is because, incredibly, the cgroup tests import ../pidfd/pidfd.h
solely to use a helper, but in doing so inadv
On Wed, Oct 23, 2024 at 10:18:28AM -0700, Shakeel Butt wrote:
> On Wed, Oct 23, 2024 at 08:18:35AM GMT, Lorenzo Stoakes wrote:
> > On Tue, Oct 22, 2024 at 05:53:00PM -0700, Shakeel Butt wrote:
> > > On Thu, Oct 17, 2024 at 10:05:50PM GMT, Lorenzo Stoakes wrote:
> > > &
On Tue, Oct 22, 2024 at 05:53:00PM -0700, Shakeel Butt wrote:
> On Thu, Oct 17, 2024 at 10:05:50PM GMT, Lorenzo Stoakes wrote:
> > It is useful to be able to utilise the pidfd mechanism to reference the
> > current thread or process (from a userland point of view - thread group
>
On Thu, Oct 17, 2024 at 10:05:50PM +0100, Lorenzo Stoakes wrote:
> It is useful to be able to utilise the pidfd mechanism to reference the
> current thread or process (from a userland point of view - thread group
> leader from the kernel's point of view).
>
> Therefore introdu
On Thu, Oct 17, 2024 at 02:45:43PM -0700, John Hubbard wrote:
> On 10/17/24 2:05 PM, Lorenzo Stoakes wrote:
> > Conflicts can arise between system fcntl.h and linux/fcntl.h, imported by
> > the linux/pidfd.h UAPI header.
> >
> > Work around this by adding a wrapper for
ed as it would require the testing process
to be dying).
Reviewed-by: Shuah Khan
Signed-off-by: Lorenzo Stoakes
---
tools/testing/selftests/pidfd/pidfd.h | 2 +
.../selftests/pidfd/pidfd_getfd_test.c| 141 ++
.../selftests/pidfd/pidfd_setns_test.c
-by: Shuah Khan
Signed-off-by: Lorenzo Stoakes
---
tools/include/linux/pidfd.h| 14 ++
tools/testing/selftests/pidfd/Makefile | 3 +--
2 files changed, 15 insertions(+), 2 deletions(-)
create mode 100644 tools/include/linux/pidfd.h
diff --git a/tools/include/linux
pid lookup and to
consistently handle this in one place.
This lays the groundwork for a subsequent patch which adds a new sentinel
pidfd to explicitly reference the current process (i.e. thread group
leader) without the need for a pidfd.
Signed-off-by: Lorenzo Stoakes
---
include/linux/pid.h |
..), process_madvise(), process_mrelease(), pidfd_send_signal(), and
pidfd_getfd() system calls.
Things such as polling a pidfs and general fd operations are not supported,
this strictly provides the sentinel for APIs which explicitly accept a
pidfd.
Signed-off-by: Lorenzo Stoakes
---
include/linux/pid.
linux-mm/cover.1727644404.git.lorenzo.stoa...@oracle.com/
Lorenzo Stoakes (4):
pidfd: extend pidfd_get_pid() and de-duplicate pid lookup
pidfd: add PIDFD_SELF_* sentinels to refer to own thread/process
selftests: pidfd: add pidfd.h UAPI wrapper
selftests: pidfd: add tests for PIDFD_SEL
On Thu, Oct 17, 2024 at 01:37:06PM -0600, Shuah Khan wrote:
> On 10/17/24 11:38, Lorenzo Stoakes wrote:
> > On Thu, Oct 17, 2024 at 10:37:00AM -0700, John Hubbard wrote:
> > > On 10/17/24 10:28 AM, Lorenzo Stoakes wrote:
> > > > On Thu, Oct 17, 2024 at 10:17:
On Thu, Oct 17, 2024 at 10:37:00AM -0700, John Hubbard wrote:
> On 10/17/24 10:28 AM, Lorenzo Stoakes wrote:
> > On Thu, Oct 17, 2024 at 10:17:54AM -0700, John Hubbard wrote:
> > > On 10/17/24 5:06 AM, Lorenzo Stoakes wrote:
> ...
> > > >
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]
> > >
&
+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
> th
On Wed, Oct 16, 2024 at 04:38:50PM -0600, Shuah Khan wrote:
> On 10/16/24 16:06, Lorenzo Stoakes wrote:
> > On Wed, Oct 16, 2024 at 02:00:27PM -0600, Shuah Khan wrote:
> > > On 10/16/24 04:20, Lorenzo Stoakes wrote:
> > > > Add tests to assert that PIDFD_SELF_* c
On Wed, Oct 16, 2024 at 07:14:34PM -0700, John Hubbard wrote:
> On 10/16/24 3:06 PM, Lorenzo Stoakes wrote:
> > On Wed, Oct 16, 2024 at 02:00:27PM -0600, Shuah Khan wrote:
> > > On 10/16/24 04:20, Lorenzo Stoakes wrote:
> ...
> > > > diff --git a/tools/testing/s
On Wed, Oct 16, 2024 at 11:06:34PM +0100, Lorenzo Stoakes wrote:
[sniip]
> >
> > The import will be fine and you can control that with -I flag in
> > the makefile. Remove these and try to get including linux/pidfd.h
> > working.
>
> I just tried this and it's n
On Wed, Oct 16, 2024 at 02:00:27PM -0600, Shuah Khan wrote:
> On 10/16/24 04:20, Lorenzo Stoakes wrote:
> > Add tests to assert that PIDFD_SELF_* correctly refers to the current
> > thread and process.
> >
> > This is only practically meaningful to pidfd_send_signal()
On Wed, Oct 16, 2024 at 03:00:55PM +0200, Christian Brauner wrote:
> On Fri, Oct 11, 2024 at 12:05:55PM +0100, Lorenzo Stoakes wrote:
> > The means by which a pid is determined from a pidfd is duplicated, with
> > some callers holding a reference to the (pid)fd, and others explici
ed as it would require the testing process
to be dying).
Signed-off-by: Lorenzo Stoakes
---
tools/testing/selftests/pidfd/pidfd.h | 8 +
.../selftests/pidfd/pidfd_getfd_test.c| 141 ++
.../selftests/pidfd/pidfd_setns_test.c| 11 ++
tools/testing/self
s such as polling a pidfs and general fd operations are not supported,
this strictly provides the sentinel for APIs which explicitly accept a
pidfd.
Signed-off-by: Lorenzo Stoakes
---
include/linux/pid.h| 9 +++---
include/uapi/linux/pidfd.h | 15 +
kernel/exit.c
s allows us to eliminate open-coded pidfd pid lookup and to
consistently handle this in one place.
This lays the groundwork for a subsequent patch which adds a new sentinel
pidfd to explicitly reference the current process (i.e. thread group
leader) without the need for a pidfd.
Signed-off-by:
S respectively.
* Updated testing accordingly.
https://lore.kernel.org/linux-mm/cover.1728578231.git.lorenzo.stoa...@oracle.com/
RFC version:
https://lore.kernel.org/linux-mm/cover.1727644404.git.lorenzo.stoa...@oracle.com/
Lorenzo Stoakes (3):
pidfd: extend pidfd_get_pid() and de-duplicat
1/3] pidfd:
> extend pidfd_get_pid() and de-duplicate pid lookup")
> url:
> https://github.com/intel-lab-lkp/linux/commits/Lorenzo-Stoakes/pidfd-extend-pidfd_get_pid-and-de-duplicate-pid-lookup/20241011-191241
> base: https://git.kernel.org/cgit/linux/kernel/git/shuah/linux-kselftest
On Wed, Oct 16, 2024 at 01:16:15AM -0700, Suren Baghdasaryan wrote:
> On Tue, Oct 15, 2024 at 11:05 PM Lorenzo Stoakes
> wrote:
> >
> > On Tue, Oct 15, 2024 at 12:40:41PM -0700, Suren Baghdasaryan wrote:
> > [snip]
> > > > -struct pid *pidfd_get_pid(
On Tue, Oct 15, 2024 at 12:40:41PM -0700, Suren Baghdasaryan wrote:
[snip]
> > -struct pid *pidfd_get_pid(unsigned int fd, unsigned int *flags)
> > +struct pid *__pidfd_get_pid(unsigned int pidfd, bool pin_pid,
> > + bool allow_proc, unsigned int *flags,
> > +
ed as it would require the testing process
to be dying).
Signed-off-by: Lorenzo Stoakes
---
tools/testing/selftests/pidfd/pidfd.h | 8 +
.../selftests/pidfd/pidfd_getfd_test.c| 141 ++
.../selftests/pidfd/pidfd_setns_test.c| 11 ++
tools/testing/self
s such as polling a pidfs and general fd operations are not supported,
this strictly provides the sentinel for APIs which explicitly accept a
pidfd.
Signed-off-by: Lorenzo Stoakes
---
include/linux/pid.h| 9 +++---
include/uapi/linux/pidfd.h | 15 +
kernel/exit.c
orenzo.stoa...@oracle.com/
Lorenzo Stoakes (3):
pidfd: extend pidfd_get_pid() and de-duplicate pid lookup
pidfd: add PIDFD_SELF_* sentinels to refer to own thread/process
selftests: pidfd: add tests for PIDFD_SELF_*
include/linux/pid.h | 43 +-
i
s allows us to eliminate open-coded pidfd pid lookup and to
consistently handle this in one place.
This lays the groundwork for a subsequent patch which adds a new sentinel
pidfd to explicitly reference the current process (i.e. thread group
leader) without the need for a pidfd.
Signed-off-by:
On Thu, Oct 10, 2024 at 05:16:22PM -0600, Shuah Khan wrote:
> On 10/10/24 12:15, Lorenzo Stoakes wrote:
> > Add tests to assert that PIDFD_SELF_* correctly refers to the current
> > thread and process.
> >
> > This is only practically meaningful to pidfd_send_signal()
ed as it would require the testing process
to be dying).
Signed-off-by: Lorenzo Stoakes
---
tools/testing/selftests/pidfd/pidfd.h | 8 ++
.../selftests/pidfd/pidfd_getfd_test.c| 136 ++
.../selftests/pidfd/pidfd_setns_test.c| 11 ++
tools/testing/self
s such as polling a pidfs and general fd operations are not supported,
this strictly provides the sentinel for APIs which explicitly accept a
pidfd.
Signed-off-by: Lorenzo Stoakes
---
include/linux/pid.h| 9 +++---
include/uapi/linux/pidfd.h | 15 +
kernel/exit.c | 3 +-
k
s allows us to eliminate open-coded pidfd pid lookup and to
consistently handle this in one place.
This lays the groundwork for a subsequent patch which adds a new sentinel
pidfd to explicitly reference the current process (i.e. thread group
leader) without the need for a pidfd.
Signed-off-by:
LF and PIDFD_SELF_PROCESS respectively.
* Updated testing accordingly.
RFC version:
https://lore.kernel.org/linux-mm/1d19f18c-5a60-44b5-a96f-9d0e74f2b02c@lucifer.local/
Lorenzo Stoakes (3):
pidfd: extend pidfd_get_pid() and de-duplicate pid lookup
pidfd: add PIDFD_SELF_* sentinels to re
On Tue, Oct 01, 2024 at 12:21:32PM GMT, Christian Brauner wrote:
> On Mon, Sep 30, 2024 at 03:32:25PM GMT, Lorenzo Stoakes wrote:
> > On Mon, Sep 30, 2024 at 04:21:23PM GMT, Aleksa Sarai wrote:
[snip]
> > > Sorry to bike-shed, but to match /proc/self and /proc/thread-self
On Mon, Sep 30, 2024 at 04:21:23PM GMT, Aleksa Sarai wrote:
> On 2024-09-30, Lorenzo Stoakes wrote:
> > On Mon, Sep 30, 2024 at 02:34:33PM GMT, Christian Brauner wrote:
> > > On Mon, Sep 30, 2024 at 11:39:49AM GMT, Lorenzo Stoakes wrote:
> > > > On Mon, Sep 30, 2
On Mon, Sep 30, 2024 at 02:34:33PM GMT, Christian Brauner wrote:
> On Mon, Sep 30, 2024 at 11:39:49AM GMT, Lorenzo Stoakes wrote:
> > On Mon, Sep 30, 2024 at 12:33:18PM GMT, Florian Weimer wrote:
> > > * Lorenzo Stoakes:
> > >
> > > > If you wish to ut
On Mon, Sep 30, 2024 at 12:33:18PM GMT, Florian Weimer wrote:
> * Lorenzo Stoakes:
>
> > If you wish to utilise a pidfd interface to refer to the current process
> > (from the point of view of userland - from the kernel point of view - the
> > thread group leader),
ch which adds a new sentinel
pidfd to explicitly reference the current process (i.e. thread group
leader) without the need for a pidfd.
Signed-off-by: Lorenzo Stoakes
---
include/linux/pid.h | 42 +-
kernel/pid.c
pidfs and general fd operations are not supported,
this strictly provides the sentinel for APIs which explicitly accept a
pidfd.
Signed-off-by: Lorenzo Stoakes
---
include/linux/pid.h| 9 +++---
include/uapi/linux/pidfd.h | 3 ++
kernel/exit.c | 3 +-
kernel/nsproxy.c
would require the testing process
to be dying).
Signed-off-by: Lorenzo Stoakes
---
tools/testing/selftests/pidfd/pidfd.h | 5 +++
.../selftests/pidfd/pidfd_getfd_test.c| 38 +++
.../selftests/pidfd/pidfd_setns_test.c| 6 +++
tools/testing/selftests/pidfd/pidfd_t
tions such as open() or poll(), as this would require extensive work
and be of no real use.
Lorenzo Stoakes (3):
pidfd: refactor pidfd_get_pid/to_pid() and de-duplicate pid lookup
pidfd: add PIDFD_SELF sentinel to refer to own process
selftests: pidfd: add tests for PIDFD_SELF
include/l
did not add these
to .gitignore. Correct this.
Signed-off-by: Lorenzo Stoakes
---
tools/testing/selftests/mm/.gitignore | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/testing/selftests/mm/.gitignore
b/tools/testing/selftests/mm/.gitignore
index da030b43e43b..689bbd520296 100644
--- a/tools/
The following commit has been merged into the x86/mm branch of tip:
Commit-ID: 167dcfc08b0b1f964ea95d410aa496fd78adf475
Gitweb:
https://git.kernel.org/tip/167dcfc08b0b1f964ea95d410aa496fd78adf475
Author:Lorenzo Stoakes
AuthorDate:Tue, 15 Dec 2020 20:56:41
Committer
Happy NY all, thanks for the review! I haven't contributed an
x86-specific mm patch before so am not sure of the process - usually I
submit patches to the mm mailing list and Andrew gathers them up into
his tree, is there anything else I need to do with this?
Thanks, Lorenzo
her 3 or 4 page tables
respectively.
This patch updates INIT_PGD_PAGE_COUNT to reflect this.
Signed-off-by: Lorenzo Stoakes
---
arch/x86/mm/init.c | 19 ++-
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index e26f5c5
On Thu, 3 Dec 2020 at 12:24, Mike Rapoport wrote:
> Yeah, the change to initialization of "unavailable" memory missed pfn 0 :(
> This should fix it:
Tried locally and it fixes the issue for me :)
lower zone this patch reverse the process and populates each zone's
lowmem_reserve[] values in ascending order.
This clarifies what is going on especially in the case of zero managed
pages or ratio which is now explicitly shown to clear these values.
Signed-off-by: Lorenzo
On Wed, 25 Nov 2020 at 06:25, Alex Shi wrote:
> Acked.
Thanks. I submitted as an actual patch, refactored it slightly to
avoid duplication of page_memcg().
> and further more, could you like try another patch?
I tried that patch against the syzkaller failure case and it worked fine!
Cheers, Lo
to assert that this
is the case.
Signed-off-by: Lorenzo Stoakes
Reported-by: syzbot+ce635500093181f39...@syzkaller.appspotmail.com
---
include/linux/memcontrol.h | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index
On Tue, 24 Nov 2020 at 07:54, syzbot
wrote:
> syzbot found the following issue on:
>
> HEAD commit:d9137320 Add linux-next specific files for 20201124
This appears to be a product of 4b2904f3 ("mm/memcg: add missed
warning in mem_cgroup_lruvec") adding a VM_WARN_ON_ONCE() to
mem_cgroup_lruvec
ommon.c
+++ b/mm/kasan/common.c
@@ -387,6 +387,11 @@ void __kasan_slab_free_mempool(void *ptr, unsigned long ip)
struct page *page;
page = virt_to_head_page(ptr);
+
+ if (!PageSlab(page)) {
+ return;
+ }
+
kasan_slab_free(page->slab_cache, ptr, i
patches were simply a
mechanical/cautious replacement for code that is more or less exactly
equivalent but if this would make sense perhaps it'd be worth using
gup_fast() where possible?
--
Lorenzo Stoakes
https://ljs.io
Moving from get_user_pages() to get_user_pages_unlocked() simplifies the code
and takes advantage of VM_FAULT_RETRY functionality when faulting in pages.
Signed-off-by: Lorenzo Stoakes
---
drivers/gpu/drm/via/via_dmablit.c | 10 +++---
1 file changed, 3 insertions(+), 7 deletions(-)
diff
On 6 January 2017 at 07:09, Lorenzo Stoakes wrote:
>
> Adding Andrew, as this may be another less active corner of the corner,
> thanks!
Hi all,
Thought I'd also give this one a gentle nudge now the merge window has
re-opened, Andrew - are you ok to pick this up? I've check
On 3 January 2017 at 21:36, Michal Hocko wrote:
> On Tue 03-01-17 21:14:20, Lorenzo Stoakes wrote:
>> Just a gentle ping on this :) I think this might be a slightly
>> abandoned corner of the kernel so not sure who else to ping to get
>> this moving.
>
> Maybe An
On 3 January 2017 at 20:23, Lorenzo Stoakes wrote:
> Hi All,
>
> Just a gentle ping on this one :)
>
> Cheers, Lorenzo
>
> On 1 November 2016 at 19:43, Lorenzo Stoakes wrote:
>> Moving from get_user_pages() to get_user_pages_unlocked() simplifies the code
>> and
1 - 100 of 236 matches
Mail list logo