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=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS 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 A596CC04AAF for ; Mon, 20 May 2019 14:01:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 863162171F for ; Mon, 20 May 2019 14:01:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403806AbfETOB2 (ORCPT ); Mon, 20 May 2019 10:01:28 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:46215 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391227AbfETOB1 (ORCPT ); Mon, 20 May 2019 10:01:27 -0400 Received: by mail-lf1-f65.google.com with SMTP id l26so10369838lfh.13; Mon, 20 May 2019 07:01:23 -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=k5M5HG3kl0pUgSauCfNvkeVzL85t6u8JUUHdn9mhx04=; b=gYRUQQ4I3isRR7yIrkfU1fErhS5LAmJO+q9UZ5/bRVsNPQluoj03UfNUL0I7XHQmPj UZ2hsjhiaoVzaX4F48wqCM37pZKXTCzzV3HcPIwpo8gXTZjDNqlW/wuS0GgG0LegM+gI cNMjXLFp96QzPp8AfhXpbUO7HQYwk8Z75SjoQ+JlGPOv46Ef1MiIn18V3x9efkcUJD9J PlxDJQZTjBlAieJyET4XPM8TZMzNQg4ZBskiE8w+m40Vm+dNE8P+s6odhuKlquJNLaoK ShIT0NSW/TwHCve/P6PCqI3YFqhqzzLZZAcghjQOTS/X+zmesDQtj3e3qaEIP8sPvIl4 /rmw== X-Gm-Message-State: APjAAAUUVMB2FLp0pKtTLw42V4U6rGCWPsCzdPM172VxiLue3r/jhsle s3lzmQVUJRMsjcNOzJSJ3ajML15pXchIyw3GjHo= X-Google-Smtp-Source: APXvYqzBXH0Bn12gU+O/WKysSzgvfoDb4ZQdIiC8js/Lv4/NzbFVAIlWC//CHbjkYuLxxyAwqyeGdyzFagcgQl6QGI8= X-Received: by 2002:a19:a887:: with SMTP id r129mr1920861lfe.16.1558360883054; Mon, 20 May 2019 07:01:23 -0700 (PDT) MIME-Version: 1.0 References: <20190520134605.29116-1-christian@brauner.io> In-Reply-To: <20190520134605.29116-1-christian@brauner.io> From: Geert Uytterhoeven Date: Mon, 20 May 2019 16:00:44 +0200 Message-ID: Subject: Re: [PATCH v2 1/2] pid: add pidfd_open() To: Christian Brauner 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, David Howells , Joel Fernandes , "open list:KERNEL SELFTEST FRAMEWORK" , sparclinux , elena.reshetova@intel.com, Linux-Arch , linux-s390 , Daniel Colascione , Android Kernel Team , "Serge E. Hallyn" , linux-xtensa@linux-xtensa.org, Kees Cook , linux-m68k , Andy Lutomirski , Thomas Gleixner , surenb@google.com, 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-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org On Mon, May 20, 2019 at 3:46 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 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 > pidfds 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. > > Signed-off-by: Christian Brauner > Reviewed-by: Oleg Nesterov > arch/m68k/kernel/syscalls/syscall.tbl | 1 + Acked-by: Geert Uytterhoeven 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