Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp517086yba; Wed, 15 May 2019 05:31:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqwfe7xKCvWG9XmTgdBoPps3ddyyO4kpoAHf06xbRjzp0Jut8IIvUr4sbLpM2kJIhhBvFRj5 X-Received: by 2002:a63:3182:: with SMTP id x124mr42850862pgx.364.1557923462733; Wed, 15 May 2019 05:31:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557923462; cv=none; d=google.com; s=arc-20160816; b=ZZR+ukpJaTrNChrmFaqWFNApMn/pvx1dmQKE1cDr/cnIx3b4AATC5korqCPgTwqxwx lBT2kJUiM7P5p1z4MgDMN4NRnmDIt3SMT5SijTdHFKJhPyIyvhxzoYDNC5iI+uJrTbVT CDIIqayH6nOKjmjwOuT3AAi+6utkRZgoCKwFZyNkDqD3gGFODAuGsRmwNykHPSPMlQY+ +mFKuQh/dztrxrEKRbSGnmE44poUXsohqN/MuL6DvcOSyVoxB3j3s1hyEEYpWqhqfYup dR6Jqqb70VrE87G4O8IJrFHhVt8o4qqChZBswM3nmDBZBROhpX//PgHxgx5UxpVILB2y 94sA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=cgdsZEIH2W5eTMf3uaLx4q/hdk2jHzw6fNgJE2/Ss+k=; b=TiEz74fO+M+0N+Uk4JuPAk78lk93i4LFu3EIxE2kRQftnIug0uAto8iesEdsQIhwYN iUNQ31j6QmyzvA0IPW8REh129OeVDxB0lSEHZt91ByLDftfqqxeARCxx6ekBOgK2Q6aI ckNwEpyk/gf3QGS6zsDcIudGftCwK01tZ8iROFoIS+5dlVF6DXd0g5M1aR+zpeXvgC2R JvmxpcECFo9fbZavHiwEerY7xUgqLl5klIhh6V+Z+YEj0ZZivVaVRaNX7kiZX59v/BKt Yx7zduTe0ZmZ+UJxCseNLClw0rgkF1FuzASvG+lBlMr6LMvytROuQABUblEVTNqpL1Rf AWiQ== ARC-Authentication-Results: i=1; mx.google.com; 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 204si1664806pgf.288.2019.05.15.05.30.47; Wed, 15 May 2019 05:31:02 -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; 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 S1727076AbfEOM32 (ORCPT + 99 others); Wed, 15 May 2019 08:29:28 -0400 Received: from mail-vs1-f68.google.com ([209.85.217.68]:37222 "EHLO mail-vs1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726803AbfEOM31 (ORCPT ); Wed, 15 May 2019 08:29:27 -0400 Received: by mail-vs1-f68.google.com with SMTP id o5so1566244vsq.4; Wed, 15 May 2019 05:29:26 -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=cgdsZEIH2W5eTMf3uaLx4q/hdk2jHzw6fNgJE2/Ss+k=; b=Kl1WAuyv9mYDtkcZTKYWwrcEjYd5h2UITDxQ0i8bc3etfxEnmdO91neWn/D44ScI5o 2dPdO26CQ2qpDl0OYOdMME31KZPnk7J8rqt+3+UpgGHGJf3t+chzENYfs7KbrbcznjdH vIvZbymPN0VSnn0Lvj2a3Rkl5szI2YD322jgtVWxlH4lV7ufSmV17xZStx7q5sWryg49 pBT++UmGoudT2A4o0d6xVTbTeqSpws9htAsHYUAgQg0bJaeFwQQVrHN7HYMFZ8iOvBTX ZHz5cXs/jzxNfwyxJFN2ZaYbWBoR9+6Ak/XcQ7PIif51U6J0arvK8IuGEdf44ZxsMA44 4y9A== X-Gm-Message-State: APjAAAUaz+8HolnY8TfWhHskyIP01Y9I2M/xPNoy+LiPFTZvtYNQJwpj XRwh9qVedYi6mqWJlHL+YhcutX43utUGBoWcLrM= X-Received: by 2002:a67:8e03:: with SMTP id q3mr20471095vsd.152.1557923365973; Wed, 15 May 2019 05:29:25 -0700 (PDT) MIME-Version: 1.0 References: <20190515100400.3450-1-christian@brauner.io> In-Reply-To: <20190515100400.3450-1-christian@brauner.io> From: Geert Uytterhoeven Date: Wed, 15 May 2019 14:29:14 +0200 Message-ID: Subject: Re: [PATCH 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 , David Howells , "linux-ia64@vger.kernel.org" , Linux-sh list , linux-mips@vger.kernel.org, "open list:KERNEL SELFTEST FRAMEWORK" , sparclinux , elena.reshetova@intel.com, Linux-Arch , linux-s390 , 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 15, 2019 at 12:04 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. > > Signed-off-by: Christian Brauner > 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