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=-3.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_NEOMUTT autolearn=ham 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 2CCA4C04AAF for ; Thu, 16 May 2019 14:58:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EA5162082E for ; Thu, 16 May 2019 14:58:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=brauner.io header.i=@brauner.io header.b="OIHOP7ru" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727491AbfEPO6X (ORCPT ); Thu, 16 May 2019 10:58:23 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:42625 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727392AbfEPO6X (ORCPT ); Thu, 16 May 2019 10:58:23 -0400 Received: by mail-ed1-f67.google.com with SMTP id l25so5675864eda.9 for ; Thu, 16 May 2019 07:58:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brauner.io; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=xCVxcbycKijjP8G1i7Lu3aOPyQvDa5anPQzLbernNO4=; b=OIHOP7rucDEqRTu8tvry5PPcTvGug7bBvZ3Sj3gEtUFrGnhyINnCk+I0zkqsLasUKZ sDF9yMxrNz3GSuRfHnJ98dcv59fxALK1XZT/DdKM+RNStSEbUml+piQP0fMEz2cT77wZ 5fUSex8dhyXEU6EezdQo3iMv+/oWdqQP14elkHUkCpZkBvTW8oAW6AfrrmA20E9iIhVk ZuAZmTbyIfWt5UMPyKY2uhM8QgCzF5SK4PrtHd7sRoTp6ulgh75hv6U20VbOqq0i/gZ+ 98BZhaBZoAMvoCxu8vxG/vqn+9IOpy6tDLSn4KBXR2pI1aOzSqOO7bUDxsGPIuc1Dou9 GnZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=xCVxcbycKijjP8G1i7Lu3aOPyQvDa5anPQzLbernNO4=; b=o0Gf3VqG6IHLhI7wfDyIkprGkQ1qFlT0QErmk8FAnM01UFhOM2xZ8GuWTJR4ehCdOK 19SFaPTGAFH7Bmw/scb3XuOJ3iQq8qr4Rg+xNLRSduoVfVar0xq0qpVPwat6iG2u7JB3 CkydJHZCqmRKvbyxIy6T2Z+AgKxAZbAEOo4x4k+1oqByoTAUOMA7QxNIRd/BTQa9UTpv hLuYOivNLabvaNjZMDMMLIJC7pr+sEHgDcvzm55nOx6oLQgU+wv4xpGDbx2hfisVH/sJ ZMyxCLh/iefQLDqS+9J4A0GH2Ts/iYa/zzZDBb/9kOtefWkdAXy6IrnXImilycPxChC5 lNbA== X-Gm-Message-State: APjAAAV/3aeR2317uTgcp8cQfGPsjtkPvCPFPmJ6+B4ImVa5vI2sGk/Z QFNmdbDqxGzUEJGgmMpUbpLPmw== X-Google-Smtp-Source: APXvYqxgJ+X2Q+jweK2Am0efdrd0ewPSsOh9NTyeRf7XaOyCGLt/MTu5duHXcow8oFtMna8nvrnWUQ== X-Received: by 2002:a17:906:c391:: with SMTP id t17mr28473151ejz.242.1558018702012; Thu, 16 May 2019 07:58:22 -0700 (PDT) Received: from brauner.io ([193.96.224.243]) by smtp.gmail.com with ESMTPSA id s15sm1924877edm.6.2019.05.16.07.58.20 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 16 May 2019 07:58:21 -0700 (PDT) Date: Thu, 16 May 2019 16:58:19 +0200 From: Christian Brauner To: Geert Uytterhoeven Cc: David Howells , 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 Subject: Re: [PATCH v1 1/2] pid: add pidfd_open() Message-ID: <20190516145819.ofqkv6ozfpumhhuk@brauner.io> References: <20190516135944.7205-1-christian@brauner.io> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org On Thu, May 16, 2019 at 04:56:08PM +0200, Geert Uytterhoeven wrote: > 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. Yep, already spotted this thanks to Arnd! Will change the syscall numbers. Thanks! Christian > > 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