From mboxrd@z Thu Jan 1 00:00:00 1970 From: Geert Uytterhoeven Date: Thu, 16 May 2019 14:56:08 +0000 Subject: Re: [PATCH v1 1/2] pid: add pidfd_open() Message-Id: List-Id: References: <20190516135944.7205-1-christian@brauner.io> In-Reply-To: <20190516135944.7205-1-christian@brauner.io> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Christian Brauner , David Howells Cc: Jann Horn , Oleg Nesterov , Al Viro , "torvalds@linux-foundation.org" , Linux Kernel Mailing List , Arnd Bergmann , "linux-ia64@vger.kernel.org" , Linux-sh list , linux-mips@vger.kernel.org, Joel Fernandes , "open list:KERNEL SELFTEST FRAMEWORK" , sparclinux , elena.reshetova@intel.com, Linux-Arch , linux-s390 , Daniel Colascione , "Serge E. Hallyn" , linux-xtensa@linux-xtensa.org, Kees Cook Hi Christian, David, On Thu, May 16, 2019 at 4:00 PM Christian Brauner wrote: > This adds the pidfd_open() syscall. It allows a caller to retrieve pollable > pidfds for a process which did not get created via CLONE_PIDFD, i.e. for a > process that is created via traditional fork()/clone() calls that is only > referenced by a PID: > > int pidfd = pidfd_open(1234, 0); > ret = pidfd_send_signal(pidfd, SIGSTOP, NULL, 0); > > With the introduction of pidfds through CLONE_PIDFD it is possible to > created pidfds at process creation time. > However, a lot of processes get created with traditional PID-based calls > such as fork() or clone() (without CLONE_PIDFD). For these processes a > caller can currently not create a pollable pidfd. This is a huge problem > for Android's low memory killer (LMK) and service managers such as systemd. > Both are examples of tools that want to make use of pidfds to get reliable > notification of process exit for non-parents (pidfd polling) and race-free > signal sending (pidfd_send_signal()). They intend to switch to this API for > process supervision/management as soon as possible. Having no way to get > pollable pidfds from PID-only processes is one of the biggest blockers for > them in adopting this api. With pidfd_open() making it possible to retrieve > pidfd for PID-based processes we enable them to adopt this api. > > In line with Arnd's recent changes to consolidate syscall numbers across > architectures, I have added the pidfd_open() syscall to all architectures > at the same time. > +428 common pidfd_open sys_pidfd_open This number conflicts with "[PATCH 4/4] uapi: Wire up the mount API syscalls on non-x86 arches", which is requested to be included before rc1. Note that none of this is part of linux-next. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6BCFFC04E84 for ; Thu, 16 May 2019 14:56:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4850F2082E for ; Thu, 16 May 2019 14:56:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727592AbfEPO4X (ORCPT ); Thu, 16 May 2019 10:56:23 -0400 Received: from mail-vk1-f193.google.com ([209.85.221.193]:43977 "EHLO mail-vk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727573AbfEPO4W (ORCPT ); Thu, 16 May 2019 10:56:22 -0400 Received: by mail-vk1-f193.google.com with SMTP id h72so1096777vkh.10; Thu, 16 May 2019 07:56:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=05GCtpont9YEywFzf84z1q9MwrqOSiu52jwQOd14/zs=; b=NqRraoEHORwbbMw0jdlkm1gqvvZ7Ona5zso2iADzUe435KgwdUeQrFVeZK1kG8w3y2 tDOGY1PhQsbuWp4zX4vuepzAtxDAz0xqKqexS2aNqtCf2ZemV+LdDZ1L3vOsk2oVrOv3 MxO25Edon6SuprOVYFKacjdA1qnVMLJNHlkwQ7goZwTRdBbKKWaNEOG0mJWa0jqyWyXt NqUhxBQRV/tfAsvKIHdEoSp4QhfDxMdJDI42EpnMOYsym5B+UsK4gjR4v4C7ch7wGZ0w XN9nhIpclGns00wQgPac8PDAASbkljVJvIS2qc3V5naQoIy4Wf4kyR6xuMSJfwWtcuhX UjmQ== X-Gm-Message-State: APjAAAXyUvKL8IARnIGhuVSdX5oNXGKE4NR6SxAcypv2R5+XyV/CC6jD mIcZY/4zymv28Z180BYrS/sXP9gzz36sJG+9a2I= X-Google-Smtp-Source: APXvYqwJkEyDq3zOtk8OfRAodMj5uaJzILWIRnCKOk3dtxYk7GsdMRXLOna8zNuSkRyU4hilGsRAQgTc6aWaoZtw994= X-Received: by 2002:a1f:c2c1:: with SMTP id s184mr23362067vkf.65.1558018580810; Thu, 16 May 2019 07:56:20 -0700 (PDT) MIME-Version: 1.0 References: <20190516135944.7205-1-christian@brauner.io> In-Reply-To: <20190516135944.7205-1-christian@brauner.io> From: Geert Uytterhoeven Date: Thu, 16 May 2019 16:56:08 +0200 Message-ID: Subject: Re: [PATCH v1 1/2] pid: add pidfd_open() To: Christian Brauner , David Howells Cc: Jann Horn , Oleg Nesterov , Al Viro , "torvalds@linux-foundation.org" , Linux Kernel Mailing List , Arnd Bergmann , "linux-ia64@vger.kernel.org" , Linux-sh list , linux-mips@vger.kernel.org, Joel Fernandes , "open list:KERNEL SELFTEST FRAMEWORK" , sparclinux , elena.reshetova@intel.com, Linux-Arch , linux-s390 , Daniel Colascione , "Serge E. Hallyn" , linux-xtensa@linux-xtensa.org, Kees Cook , linux-m68k , Andy Lutomirski , Thomas Gleixner , Linux ARM , Parisc List , Linux API , cyphar@cyphar.com, Andy Lutomirski , "Eric W. Biederman" , alpha , Andrew Morton , linuxppc-dev Content-Type: text/plain; charset="UTF-8" Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org Hi Christian, David, On Thu, May 16, 2019 at 4:00 PM Christian Brauner wrote: > This adds the pidfd_open() syscall. It allows a caller to retrieve pollable > pidfds for a process which did not get created via CLONE_PIDFD, i.e. for a > process that is created via traditional fork()/clone() calls that is only > referenced by a PID: > > int pidfd = pidfd_open(1234, 0); > ret = pidfd_send_signal(pidfd, SIGSTOP, NULL, 0); > > With the introduction of pidfds through CLONE_PIDFD it is possible to > created pidfds at process creation time. > However, a lot of processes get created with traditional PID-based calls > such as fork() or clone() (without CLONE_PIDFD). For these processes a > caller can currently not create a pollable pidfd. This is a huge problem > for Android's low memory killer (LMK) and service managers such as systemd. > Both are examples of tools that want to make use of pidfds to get reliable > notification of process exit for non-parents (pidfd polling) and race-free > signal sending (pidfd_send_signal()). They intend to switch to this API for > process supervision/management as soon as possible. Having no way to get > pollable pidfds from PID-only processes is one of the biggest blockers for > them in adopting this api. With pidfd_open() making it possible to retrieve > pidfd for PID-based processes we enable them to adopt this api. > > In line with Arnd's recent changes to consolidate syscall numbers across > architectures, I have added the pidfd_open() syscall to all architectures > at the same time. > +428 common pidfd_open sys_pidfd_open This number conflicts with "[PATCH 4/4] uapi: Wire up the mount API syscalls on non-x86 arches", which is requested to be included before rc1. Note that none of this is part of linux-next. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds From mboxrd@z Thu Jan 1 00:00:00 1970 From: Geert Uytterhoeven Subject: Re: [PATCH v1 1/2] pid: add pidfd_open() Date: Thu, 16 May 2019 16:56:08 +0200 Message-ID: References: <20190516135944.7205-1-christian@brauner.io> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: In-Reply-To: <20190516135944.7205-1-christian@brauner.io> Sender: linux-kernel-owner@vger.kernel.org List-Archive: List-Post: To: Christian Brauner , David Howells Cc: Jann Horn , Oleg Nesterov , Al Viro , "torvalds@linux-foundation.org" , Linux Kernel Mailing List , Arnd Bergmann , "linux-ia64@vger.kernel.org" , Linux-sh list , linux-mips@vger.kernel.org, Joel Fernandes , "open list:KERNEL SELFTEST FRAMEWORK" , sparclinux , elena.reshetova@intel.com, Linux-Arch , linux-s390 , Daniel Colascione , "Serge E. Hallyn" , linux-xtensa@linux-xtensa.org, Kees Cook List-ID: Hi Christian, David, On Thu, May 16, 2019 at 4:00 PM Christian Brauner wrote: > This adds the pidfd_open() syscall. It allows a caller to retrieve pollable > pidfds for a process which did not get created via CLONE_PIDFD, i.e. for a > process that is created via traditional fork()/clone() calls that is only > referenced by a PID: > > int pidfd = pidfd_open(1234, 0); > ret = pidfd_send_signal(pidfd, SIGSTOP, NULL, 0); > > With the introduction of pidfds through CLONE_PIDFD it is possible to > created pidfds at process creation time. > However, a lot of processes get created with traditional PID-based calls > such as fork() or clone() (without CLONE_PIDFD). For these processes a > caller can currently not create a pollable pidfd. This is a huge problem > for Android's low memory killer (LMK) and service managers such as systemd. > Both are examples of tools that want to make use of pidfds to get reliable > notification of process exit for non-parents (pidfd polling) and race-free > signal sending (pidfd_send_signal()). They intend to switch to this API for > process supervision/management as soon as possible. Having no way to get > pollable pidfds from PID-only processes is one of the biggest blockers for > them in adopting this api. With pidfd_open() making it possible to retrieve > pidfd for PID-based processes we enable them to adopt this api. > > In line with Arnd's recent changes to consolidate syscall numbers across > architectures, I have added the pidfd_open() syscall to all architectures > at the same time. > +428 common pidfd_open sys_pidfd_open This number conflicts with "[PATCH 4/4] uapi: Wire up the mount API syscalls on non-x86 arches", which is requested to be included before rc1. Note that none of this is part of linux-next. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds From mboxrd@z Thu Jan 1 00:00:00 1970 From: geert at linux-m68k.org (Geert Uytterhoeven) Date: Thu, 16 May 2019 16:56:08 +0200 Subject: [PATCH v1 1/2] pid: add pidfd_open() In-Reply-To: <20190516135944.7205-1-christian@brauner.io> References: <20190516135944.7205-1-christian@brauner.io> Message-ID: Hi Christian, David, On Thu, May 16, 2019 at 4:00 PM Christian Brauner wrote: > This adds the pidfd_open() syscall. It allows a caller to retrieve pollable > pidfds for a process which did not get created via CLONE_PIDFD, i.e. for a > process that is created via traditional fork()/clone() calls that is only > referenced by a PID: > > int pidfd = pidfd_open(1234, 0); > ret = pidfd_send_signal(pidfd, SIGSTOP, NULL, 0); > > With the introduction of pidfds through CLONE_PIDFD it is possible to > created pidfds at process creation time. > However, a lot of processes get created with traditional PID-based calls > such as fork() or clone() (without CLONE_PIDFD). For these processes a > caller can currently not create a pollable pidfd. This is a huge problem > for Android's low memory killer (LMK) and service managers such as systemd. > Both are examples of tools that want to make use of pidfds to get reliable > notification of process exit for non-parents (pidfd polling) and race-free > signal sending (pidfd_send_signal()). They intend to switch to this API for > process supervision/management as soon as possible. Having no way to get > pollable pidfds from PID-only processes is one of the biggest blockers for > them in adopting this api. With pidfd_open() making it possible to retrieve > pidfd for PID-based processes we enable them to adopt this api. > > In line with Arnd's recent changes to consolidate syscall numbers across > architectures, I have added the pidfd_open() syscall to all architectures > at the same time. > +428 common pidfd_open sys_pidfd_open This number conflicts with "[PATCH 4/4] uapi: Wire up the mount API syscalls on non-x86 arches", which is requested to be included before rc1. Note that none of this is part of linux-next. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds From mboxrd@z Thu Jan 1 00:00:00 1970 From: geert@linux-m68k.org (Geert Uytterhoeven) Date: Thu, 16 May 2019 16:56:08 +0200 Subject: [PATCH v1 1/2] pid: add pidfd_open() In-Reply-To: <20190516135944.7205-1-christian@brauner.io> References: <20190516135944.7205-1-christian@brauner.io> Message-ID: Content-Type: text/plain; charset="UTF-8" Message-ID: <20190516145608.U3PPqsJIP_QvbLRYSCycQh1NWhnuxyU5VQBro0APe1c@z> Hi Christian, David, On Thu, May 16, 2019@4:00 PM Christian Brauner wrote: > This adds the pidfd_open() syscall. It allows a caller to retrieve pollable > pidfds for a process which did not get created via CLONE_PIDFD, i.e. for a > process that is created via traditional fork()/clone() calls that is only > referenced by a PID: > > int pidfd = pidfd_open(1234, 0); > ret = pidfd_send_signal(pidfd, SIGSTOP, NULL, 0); > > With the introduction of pidfds through CLONE_PIDFD it is possible to > created pidfds at process creation time. > However, a lot of processes get created with traditional PID-based calls > such as fork() or clone() (without CLONE_PIDFD). For these processes a > caller can currently not create a pollable pidfd. This is a huge problem > for Android's low memory killer (LMK) and service managers such as systemd. > Both are examples of tools that want to make use of pidfds to get reliable > notification of process exit for non-parents (pidfd polling) and race-free > signal sending (pidfd_send_signal()). They intend to switch to this API for > process supervision/management as soon as possible. Having no way to get > pollable pidfds from PID-only processes is one of the biggest blockers for > them in adopting this api. With pidfd_open() making it possible to retrieve > pidfd for PID-based processes we enable them to adopt this api. > > In line with Arnd's recent changes to consolidate syscall numbers across > architectures, I have added the pidfd_open() syscall to all architectures > at the same time. > +428 common pidfd_open sys_pidfd_open This number conflicts with "[PATCH 4/4] uapi: Wire up the mount API syscalls on non-x86 arches", which is requested to be included before rc1. Note that none of this is part of linux-next. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vk1-f193.google.com ([209.85.221.193]:43977 "EHLO mail-vk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727573AbfEPO4W (ORCPT ); Thu, 16 May 2019 10:56:22 -0400 MIME-Version: 1.0 References: <20190516135944.7205-1-christian@brauner.io> In-Reply-To: <20190516135944.7205-1-christian@brauner.io> From: Geert Uytterhoeven Date: Thu, 16 May 2019 16:56:08 +0200 Message-ID: Subject: Re: [PATCH v1 1/2] pid: add pidfd_open() Content-Type: text/plain; charset="UTF-8" Sender: linux-arch-owner@vger.kernel.org List-ID: To: Christian Brauner , David Howells Cc: Jann Horn , Oleg Nesterov , Al Viro , "torvalds@linux-foundation.org" , Linux Kernel Mailing List , Arnd Bergmann , "linux-ia64@vger.kernel.org" , Linux-sh list , linux-mips@vger.kernel.org, Joel Fernandes , "open list:KERNEL SELFTEST FRAMEWORK" , sparclinux , elena.reshetova@intel.com, Linux-Arch , linux-s390 , Daniel Colascione , "Serge E. Hallyn" , linux-xtensa@linux-xtensa.org, Kees Cook , linux-m68k , Andy Lutomirski , Thomas Gleixner , Linux ARM , Parisc List , Linux API , cyphar@cyphar.com, Andy Lutomirski , "Eric W. Biederman" , alpha , Andrew Morton , linuxppc-dev Message-ID: <20190516145608.9jxonUgcGWpyG_9nikhpZhjPA8--dvkwlm34n0e8wWc@z> Hi Christian, David, On Thu, May 16, 2019 at 4:00 PM Christian Brauner wrote: > This adds the pidfd_open() syscall. It allows a caller to retrieve pollable > pidfds for a process which did not get created via CLONE_PIDFD, i.e. for a > process that is created via traditional fork()/clone() calls that is only > referenced by a PID: > > int pidfd = pidfd_open(1234, 0); > ret = pidfd_send_signal(pidfd, SIGSTOP, NULL, 0); > > With the introduction of pidfds through CLONE_PIDFD it is possible to > created pidfds at process creation time. > However, a lot of processes get created with traditional PID-based calls > such as fork() or clone() (without CLONE_PIDFD). For these processes a > caller can currently not create a pollable pidfd. This is a huge problem > for Android's low memory killer (LMK) and service managers such as systemd. > Both are examples of tools that want to make use of pidfds to get reliable > notification of process exit for non-parents (pidfd polling) and race-free > signal sending (pidfd_send_signal()). They intend to switch to this API for > process supervision/management as soon as possible. Having no way to get > pollable pidfds from PID-only processes is one of the biggest blockers for > them in adopting this api. With pidfd_open() making it possible to retrieve > pidfd for PID-based processes we enable them to adopt this api. > > In line with Arnd's recent changes to consolidate syscall numbers across > architectures, I have added the pidfd_open() syscall to all architectures > at the same time. > +428 common pidfd_open sys_pidfd_open This number conflicts with "[PATCH 4/4] uapi: Wire up the mount API syscalls on non-x86 arches", which is requested to be included before rc1. Note that none of this is part of linux-next. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1800C04AAF for ; Thu, 16 May 2019 14:58:59 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 393502082E for ; Thu, 16 May 2019 14:58:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 393502082E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 454ZLm3yPjzDqd9 for ; Fri, 17 May 2019 00:58:56 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=209.85.221.194; helo=mail-vk1-f194.google.com; envelope-from=geert.uytterhoeven@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Received: from mail-vk1-f194.google.com (mail-vk1-f194.google.com [209.85.221.194]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 454ZHr3RdTzDqcN for ; Fri, 17 May 2019 00:56:24 +1000 (AEST) Received: by mail-vk1-f194.google.com with SMTP id p24so1110169vki.5 for ; Thu, 16 May 2019 07:56:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=05GCtpont9YEywFzf84z1q9MwrqOSiu52jwQOd14/zs=; b=L/sSaZEZPYSqFXHzfC9gsrKtD1T+NjUwgVAExGkjfdw4Ko1GVcdQxpWUO1ps3/uwOC +RR7PGe7aMQexVDCmY0v2sk6y6kchPx8+Cu9hHdApTtgdkzToRmpSLXhobSkw2/jc6sF T6zd7cY5yiFq6o/EkVOxxg9l0OROfuOjOb8UYgxWXMhJiSv33O6WdNbD/EyU8w8I9X+g PMa8sPITS5uy+U8hnko1zrYjWiy3qcAU4gFIigqeutEklDpZZ+N1MvNm+qK88+++elpC TuXGISrboEChb8LSb639MIsNcun1vZeQwPn5eE9F18+Nx9dQjXfKUkiB5Nj1DFnd+HNT /hKw== X-Gm-Message-State: APjAAAVFSRSGxa9aTrPs7y9wxk4BX9lPoqAnq+flr4DB1Yqk7T0exMnG m8Bc1ou6gcXeaX+qhUOXpOQZtKq1EvxZtSMUPUE= X-Google-Smtp-Source: APXvYqwJkEyDq3zOtk8OfRAodMj5uaJzILWIRnCKOk3dtxYk7GsdMRXLOna8zNuSkRyU4hilGsRAQgTc6aWaoZtw994= X-Received: by 2002:a1f:c2c1:: with SMTP id s184mr23362067vkf.65.1558018580810; Thu, 16 May 2019 07:56:20 -0700 (PDT) MIME-Version: 1.0 References: <20190516135944.7205-1-christian@brauner.io> In-Reply-To: <20190516135944.7205-1-christian@brauner.io> From: Geert Uytterhoeven Date: Thu, 16 May 2019 16:56:08 +0200 Message-ID: Subject: Re: [PATCH v1 1/2] pid: add pidfd_open() To: Christian Brauner , David Howells Content-Type: text/plain; charset="UTF-8" X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "linux-ia64@vger.kernel.org" , Linux-sh list , Oleg Nesterov , Joel Fernandes , "open list:KERNEL SELFTEST FRAMEWORK" , sparclinux , elena.reshetova@intel.com, Linux-Arch , linux-s390 , Daniel Colascione , linux-mips@vger.kernel.org, "Serge E. Hallyn" , linux-xtensa@linux-xtensa.org, Kees Cook , Arnd Bergmann , Jann Horn , linuxppc-dev , linux-m68k , Al Viro , Andy Lutomirski , Thomas Gleixner , Linux ARM , Parisc List , cyphar@cyphar.com, Linux API , Linux Kernel Mailing List , Andy Lutomirski , "Eric W. Biederman" , alpha , Andrew Morton , "torvalds@linux-foundation.org" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Hi Christian, David, On Thu, May 16, 2019 at 4:00 PM Christian Brauner wrote: > This adds the pidfd_open() syscall. It allows a caller to retrieve pollable > pidfds for a process which did not get created via CLONE_PIDFD, i.e. for a > process that is created via traditional fork()/clone() calls that is only > referenced by a PID: > > int pidfd = pidfd_open(1234, 0); > ret = pidfd_send_signal(pidfd, SIGSTOP, NULL, 0); > > With the introduction of pidfds through CLONE_PIDFD it is possible to > created pidfds at process creation time. > However, a lot of processes get created with traditional PID-based calls > such as fork() or clone() (without CLONE_PIDFD). For these processes a > caller can currently not create a pollable pidfd. This is a huge problem > for Android's low memory killer (LMK) and service managers such as systemd. > Both are examples of tools that want to make use of pidfds to get reliable > notification of process exit for non-parents (pidfd polling) and race-free > signal sending (pidfd_send_signal()). They intend to switch to this API for > process supervision/management as soon as possible. Having no way to get > pollable pidfds from PID-only processes is one of the biggest blockers for > them in adopting this api. With pidfd_open() making it possible to retrieve > pidfd for PID-based processes we enable them to adopt this api. > > In line with Arnd's recent changes to consolidate syscall numbers across > architectures, I have added the pidfd_open() syscall to all architectures > at the same time. > +428 common pidfd_open sys_pidfd_open This number conflicts with "[PATCH 4/4] uapi: Wire up the mount API syscalls on non-x86 arches", which is requested to be included before rc1. Note that none of this is part of linux-next. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC9C3C04AAF for ; Thu, 16 May 2019 14:56:31 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B02142082E for ; Thu, 16 May 2019 14:56:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="dHmzlACR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B02142082E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=T3TRGEQ6hkyNtLF2SM4U6b7BJitou5vcyhVwgSU2rTM=; b=dHmzlACR1FPki3 YB9+uO7wZGhP/VP9T0QWxctBwkGlo5gH5RTccFUVzK0TlFc9cQ3icpzv7u+Pxh8FzwFfLyqwHAe4t rn0m4Iv55eD8OdmHqb9Lvy5C7ivOn0t41ab9g9J7US/zr8XMPyQAzMOWiNHe/P3D++vcVJ6d9R3Bb GXNQ+3HHQnMZBXzcCTkQcHr6gZViul0Ax3+qnGgKpjPsGo993O2cAZcJtd/Yk/JHY1u8eAjld+Mbp RSNVPT9RjpnzLLi7iWTow/ry290Oskb40qbz7kD5ni2Bw5pZ7z+uVExaKMiDodmnZhzo+EKOMSNU/ 2oFDxhWojjdGuuzcLI7Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hRHo2-0006bw-1k; Thu, 16 May 2019 14:56:26 +0000 Received: from mail-vk1-f194.google.com ([209.85.221.194]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hRHny-0006bO-Mf for linux-arm-kernel@lists.infradead.org; Thu, 16 May 2019 14:56:24 +0000 Received: by mail-vk1-f194.google.com with SMTP id u131so1100922vke.9 for ; Thu, 16 May 2019 07:56:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=05GCtpont9YEywFzf84z1q9MwrqOSiu52jwQOd14/zs=; b=qtUETAHRGh2LdomqY23rYjlSIV0Rr8bsYn1cjqHqjxnhgPFVd210YPL8n8NinmUY9p McTXP+dTirZPCk1V4DyFj444yQhLROrW710sE5LhwB9XQs0Q+OvQr81CPPGbhsIYvUxN kXdQZFOzq2boUQEZOmAV/cgGO40ZvIva2DY9Jw/W8eyCUeRAPxe/mH9l/hLkX+ed9Z9q yb4Z27XaqzeLxwAQBuVXICsUiQWjEWd6FMp4hNOdFvFSg3xekF7kUjaBPLvJei3E4lS3 bz1Tgsov1rzphYxwZWdorecyeAQYwCZA9Utenqagb1PL7hSIzwbIHIgG+D8OdZXZdeMw JM/A== X-Gm-Message-State: APjAAAWflGHAlA+Tk87YlNaPKO9zin/uwX9sentgnU4ZeJow8BcxN1zf H7xTyj/Mxbc0ixt3MYZ8YWbR3aMTl2dJwqFH7ko= X-Google-Smtp-Source: APXvYqwJkEyDq3zOtk8OfRAodMj5uaJzILWIRnCKOk3dtxYk7GsdMRXLOna8zNuSkRyU4hilGsRAQgTc6aWaoZtw994= X-Received: by 2002:a1f:c2c1:: with SMTP id s184mr23362067vkf.65.1558018580810; Thu, 16 May 2019 07:56:20 -0700 (PDT) MIME-Version: 1.0 References: <20190516135944.7205-1-christian@brauner.io> In-Reply-To: <20190516135944.7205-1-christian@brauner.io> From: Geert Uytterhoeven Date: Thu, 16 May 2019 16:56:08 +0200 Message-ID: Subject: Re: [PATCH v1 1/2] pid: add pidfd_open() To: Christian Brauner , David Howells X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190516_075622_742223_08B9E02A X-CRM114-Status: GOOD ( 16.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "linux-ia64@vger.kernel.org" , Linux-sh list , Oleg Nesterov , Joel Fernandes , "open list:KERNEL SELFTEST FRAMEWORK" , sparclinux , elena.reshetova@intel.com, Linux-Arch , linux-s390 , Daniel Colascione , linux-mips@vger.kernel.org, "Serge E. Hallyn" , linux-xtensa@linux-xtensa.org, Kees Cook , Arnd Bergmann , Jann Horn , linuxppc-dev , linux-m68k , Al Viro , Andy Lutomirski , Thomas Gleixner , Linux ARM , Parisc List , cyphar@cyphar.com, Linux API , Linux Kernel Mailing List , Andy Lutomirski , "Eric W. Biederman" , alpha , Andrew Morton , "torvalds@linux-foundation.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Christian, David, On Thu, May 16, 2019 at 4:00 PM Christian Brauner wrote: > This adds the pidfd_open() syscall. It allows a caller to retrieve pollable > pidfds for a process which did not get created via CLONE_PIDFD, i.e. for a > process that is created via traditional fork()/clone() calls that is only > referenced by a PID: > > int pidfd = pidfd_open(1234, 0); > ret = pidfd_send_signal(pidfd, SIGSTOP, NULL, 0); > > With the introduction of pidfds through CLONE_PIDFD it is possible to > created pidfds at process creation time. > However, a lot of processes get created with traditional PID-based calls > such as fork() or clone() (without CLONE_PIDFD). For these processes a > caller can currently not create a pollable pidfd. This is a huge problem > for Android's low memory killer (LMK) and service managers such as systemd. > Both are examples of tools that want to make use of pidfds to get reliable > notification of process exit for non-parents (pidfd polling) and race-free > signal sending (pidfd_send_signal()). They intend to switch to this API for > process supervision/management as soon as possible. Having no way to get > pollable pidfds from PID-only processes is one of the biggest blockers for > them in adopting this api. With pidfd_open() making it possible to retrieve > pidfd for PID-based processes we enable them to adopt this api. > > In line with Arnd's recent changes to consolidate syscall numbers across > architectures, I have added the pidfd_open() syscall to all architectures > at the same time. > +428 common pidfd_open sys_pidfd_open This number conflicts with "[PATCH 4/4] uapi: Wire up the mount API syscalls on non-x86 arches", which is requested to be included before rc1. Note that none of this is part of linux-next. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel