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=-5.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_NEOMUTT autolearn=unavailable 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 0445CC04AAF for ; Tue, 21 May 2019 14:34:11 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 464D021773 for ; Tue, 21 May 2019 14:34:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=brauner.io header.i=@brauner.io header.b="R7tC9jV5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 464D021773 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=brauner.io Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 457dYr1S3czDqPK for ; Wed, 22 May 2019 00:34:08 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=brauner.io (client-ip=2607:f8b0:4864:20::644; helo=mail-pl1-x644.google.com; envelope-from=christian@brauner.io; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=brauner.io Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=brauner.io header.i=@brauner.io header.b="R7tC9jV5"; dkim-atps=neutral Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 457dXB6W3XzDqHh for ; Wed, 22 May 2019 00:32:42 +1000 (AEST) Received: by mail-pl1-x644.google.com with SMTP id g21so480295plq.0 for ; Tue, 21 May 2019 07:32:42 -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=CyEpPRrV9RS3Zg004GbU3opzLF2psDEeRox6G2Dzgi4=; b=R7tC9jV5a+mxQO62x+PWvbdzprD7UnwlstIi1E921IR8MQwvIjqpWXEjFq96wgtFnG fTY3nrMJ7vCArpwoCVItDxzdQ40Qirw2JBMtmG9CODfWHtTXbOzlgqZAKYfvraG5V/E/ frjGG7jnSr228cVlsj/AYjMiDaehudskW3T4AmnYaTekKHbr2YRWH9MAzfQSuPvXNkig nGR3hP9fBOFFBpPON8OQVuBm2SSMmqqE80W+7bGmI4VUShRRrCVcCUx8VLhizIP/+v8d eMhf2YFuLCOUzRqivSwvxO5aWPP4xWsn3q69TEqczL5TXIDQcUFBiSLNtQvcQ37Ukm91 n7lQ== 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=CyEpPRrV9RS3Zg004GbU3opzLF2psDEeRox6G2Dzgi4=; b=jEfyZ/ZWZBKz1N9l4nMKRKasJijGtVypSDcX2MLJT5kv7XWbpLhazKPq0j7JSQugG4 kTX0mt1eat7RCkpEsQ8AJ+sml+f4b3ZlvsmoyuQbi/dW01ZYIeKilSXSwZObb6pk7ykI kBwsnq3EAjjKASqR8zr9XJo+KBKDBNcq/uIhwHYENsRwfuXWr+lwpm0d6r9cH00QC1OU wnhsXw1LoIFmoJCcSJQvE2Tt9fHRowqJ8mZKQ+/lNf/jVw3Xf+Xf2k8Ilnpog9umzJzZ 8h9EYK8j3L5iWelT0jdCg89W7dXVbzSWIIHkF+bvV0v9vMxBiMMg+AZrnAzRoUkD+Xzf s+RQ== X-Gm-Message-State: APjAAAWYLWhIiQvJ4Eupyk5TiwaMr/J/IyjBmZucf+VEVlsFSJJJ1+Bt K5P6BHrH7L9nMdCHb8sDlVOzbA== X-Google-Smtp-Source: APXvYqzfSnHKDaWx/UeH1zZV9VxL0yBVD2SxGAqwuR5ORrqMhe2WMo1TCAFF94hkLIeOM4eQM6MVkw== X-Received: by 2002:a17:902:ba88:: with SMTP id k8mr9263163pls.16.1558449159148; Tue, 21 May 2019 07:32:39 -0700 (PDT) Received: from brauner.io ([208.54.39.182]) by smtp.gmail.com with ESMTPSA id q5sm25819914pfb.51.2019.05.21.07.32.25 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 21 May 2019 07:32:38 -0700 (PDT) Date: Tue, 21 May 2019 16:32:22 +0200 From: Christian Brauner To: jannh@google.com, oleg@redhat.com, viro@zeniv.linux.org.uk, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, arnd@arndb.de Subject: Re: [PATCH v3 1/2] pid: add pidfd_open() Message-ID: <20190521143220.crb2zyvdov3fl4g7@brauner.io> References: <20190520155630.21684-1-christian@brauner.io> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190520155630.21684-1-christian@brauner.io> User-Agent: NeoMutt/20180716 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-ia64@vger.kernel.org, linux-sh@vger.kernel.org, linux-mips@vger.kernel.org, dhowells@redhat.com, joel@joelfernandes.org, linux-kselftest@vger.kernel.org, sparclinux@vger.kernel.org, elena.reshetova@intel.com, linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, dancol@google.com, kernel-team@android.com, serge@hallyn.com, linux-xtensa@linux-xtensa.org, keescook@chromium.org, linux-m68k@lists.linux-m68k.org, luto@kernel.org, tglx@linutronix.de, surenb@google.com, linux-arm-kernel@lists.infradead.org, linux-parisc@vger.kernel.org, linux-api@vger.kernel.org, cyphar@cyphar.com, luto@amacapital.net, ebiederm@xmission.com, linux-alpha@vger.kernel.org, akpm@linux-foundation.org, linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Mon, May 20, 2019 at 05:56:29PM +0200, 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 This now also carries a Reviewed-by from David. > Acked-by: Arnd Bergmann > Cc: "Eric W. Biederman" > Cc: Kees Cook > Cc: Joel Fernandes (Google) > Cc: Thomas Gleixner > Cc: Jann Horn > Cc: David Howells > Cc: Andy Lutomirsky > Cc: Andrew Morton > Cc: Aleksa Sarai > Cc: Linus Torvalds > Cc: Al Viro > Cc: linux-api@vger.kernel.org I've moved pidfd_open() into my for-next branch together with Joel's pidfd polling changes. Everything is based on v5.2-rc1. The chosen syscall number for now is 434. David is going to send out another pile of mount api related syscalls. I'll coordinate with him accordingly prior to the 5.3 merge window. Thanks! Christian