Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp722899yba; Thu, 16 May 2019 07:59:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqw2cINimQlxxWELPOJ7DELFvicPbtu5S7zEBS88Msw5WHp0QRVlVPV2XRLWTGlHmhkGu0pd X-Received: by 2002:a17:902:20e2:: with SMTP id v31mr51298858plg.138.1558018752593; Thu, 16 May 2019 07:59:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558018752; cv=none; d=google.com; s=arc-20160816; b=To2SX8D8fsIyCeFBOipoaIoUqiHtQs5ryFkLuRM0YtEm5FMAlz3uhdMvs5VczIEEIT UQrzpU69net+v0pQW92tsdEKIAP/r4HTs/w8a3SkeD+J5lFUfXyX92RsjSzrGmzfds13 +OGtWlFEjUOJm7+JYkSjee991DI8TLMF8syETWbREeYKTc9MVImmbGn5aAIpHQ+gbB5G M/rBamIufXcxP+8YWTASZTCqIh9VXzCa0ztMwfV6ykd4acloCj+IhSqcc4bgoZagYV7b 3XLfLRTbEkwKvXvThlDkE+5pJDIGKBV3QaBh46sjogLrOFDNE0a9aCfP71o1HrNgtbIv aeRg== 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=05GCtpont9YEywFzf84z1q9MwrqOSiu52jwQOd14/zs=; b=C2dV7PEU5x0LdCGnumYsDQ+BvQ51Eeg86BDBVu+SMUhU4FT9bghAsVNtDZTj0Kq4o7 rdCPx++gfLlDbvBF+lz1VVAnrxRug6AuMpnNjnqfx1ZM84f8PKC63TE7/PdwD/jtrh+b +Z0FRq6DvyKL+29VEoP7PITYeInwNeZcOtX7s7gZ1JY2dVGGi+SPvaqfLmH1p1QcFJSe KdS4UFhVxAtcVkc6ypbDnXCD/0+0Yj8mTbtKCJ1lbxSplvXdDz380n38yJ/Ooj82yyHQ gFdqBLeg2MGdQ45pBXyro0jSHf/df59MOjdbDqdqwnSEbhE6/5rSVarnd+8lhh+qX0IY TsTQ== 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 p127si3836739pgp.217.2019.05.16.07.58.57; Thu, 16 May 2019 07:59:12 -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 S1727622AbfEPO4Y (ORCPT + 99 others); Thu, 16 May 2019 10:56:24 -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-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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