Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp723617yba; Thu, 16 May 2019 07:59:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqxJseWXu9UYj0vZkQrHjYiB71qxhkfa9d0SXB2zy2TUrj2cVQddOAW7hpHNnXJGDvK+42zP X-Received: by 2002:a63:da14:: with SMTP id c20mr50599006pgh.191.1558018794635; Thu, 16 May 2019 07:59:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558018794; cv=none; d=google.com; s=arc-20160816; b=KQ0bZ4TIBkvNz9+nXlpsXizguxUdadTQ0xb1+Jl7iEMEfp81lRXUYF7UgCKoRILDZR zi7RO48W8ZzlWyJIR10n4zK2hO2pH8hreKQS0ZOouR1q/t+lHoUksReYDhwGCpjZLtoN 1Qo/IJqyWe3ZtGZLUFKzB97RH0ZqFr18pCYGhhtfK6Rvlbfcrm8/lC6RVojThPPDAwx9 zeDsNesxh36sjyrUIp+Jf4GOh+u8COuKTfCAyW5HCRmxMcxK0iSlfFyZ5CxURFyqnmZP 8K3Z+j+Fuq1xSTDGxBJZsg/Xia3d8mhrlOHlGM3LRUJSfKlSyX+krLCZkD5l8K6biJJV OmXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=xCVxcbycKijjP8G1i7Lu3aOPyQvDa5anPQzLbernNO4=; b=mjr7PW44Gq9oaTvoQ1ARfqo4YhtpVJdbNpqnH0ftwo/f0MQWWIGnmGXEf9bOXnvGeb tK1NCgIlSwl+PsWM4ZQ2AHf7XMKzp25wdhSilMVHnXLjsrVxekxkV+UaVMxDmI21WANN HnDdSf9hFiMSzloyDEn++7wCTa/WkMCfuEs2iZogx5T3pRLNLHoPo9+r91WH25HjQ90z CWuEPekCXxUl5O7F/enj1ep2Ym6pp+VXgcq32mGU6WU0LB2k4EM/5RUgsOMH79IGn+fa OD54d2meL/P0WH+ok+azwx+AiTq5wucRkAaADybRs6vHrXV0Nf1NYV1Umz6gb1icr51P UkDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brauner.io header.s=google header.b=OIHOP7ru; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s4si4885882plp.59.2019.05.16.07.59.38; Thu, 16 May 2019 07:59:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@brauner.io header.s=google header.b=OIHOP7ru; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727532AbfEPO6Z (ORCPT + 99 others); Thu, 16 May 2019 10:58:25 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:44226 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727461AbfEPO6X (ORCPT ); Thu, 16 May 2019 10:58:23 -0400 Received: by mail-ed1-f68.google.com with SMTP id b8so5649251edm.11 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=nwx8Gcw4YeMWhPUNdfaAf/JDXMHorI7YWk080KUVUTf7oRVwq5IAMexsgI3VQrhMLg eiRQvrT84+j7txOZe6tKHrI3ZHOoWveDHGK+QM6Vw/X4aREpiTV99SCgXr5BBqIjvIV6 9EEMvw+SdlEX69JK0EX0rrZgdpw+Nm/7WD255STUNXzBXfm72M8T+3XB67/m61E85MDI VTLQeBSDSJ9hy5a4csejyNrURNBiVgYYwxr0Of6Oe4J9fdkZliXmloVzYciSWPwlkzU/ o6Js+GAIUurUO3PSKn22uPsXd6NLG6ftSnKX2FLjIHmEnF/EjeUJqH8MyNgxrNiTczg0 w4Sg== X-Gm-Message-State: APjAAAUZmwpW4Ez5/Xs6GzER03neU1Wt/PtABArTbqEpjICdMVpUylZb /KaSOXKqCscaMBB3cfd0XJ2GAg== 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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