Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10765754imu; Thu, 6 Dec 2018 06:29:55 -0800 (PST) X-Google-Smtp-Source: AFSGD/Vb4sJUZGPRZeiEHc374PfaFbIQ/b83/NBWQKzqJ9Jh3O+mUbmwrcHRL7316wYnk2qtfLTs X-Received: by 2002:a62:644:: with SMTP id 65mr28843352pfg.161.1544106595373; Thu, 06 Dec 2018 06:29:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544106595; cv=none; d=google.com; s=arc-20160816; b=qpfm3wTNRHLEExxHw/WQikvbHVKhzobVcwiYxO8k7og0K/tGLfkHA06tIXyAhboA9o UnUelWUCr2L3dCY3UzZMVTFw8gdjaNfcmnBUFQMw14MuMUN0S7aqWkGV+eir8QaJwNAg HZV0BPxCJfCXwx7iEqQ97jyuqG3kf0OMMB6Nmjk7KXDLyw4KbAcwZMeRGUfd3JuzIO+1 xDfAg0Gwg1/cTVcmLm6oHKpKSoWFohBjiTyiI6j7N4ktIIqx6B9KGX0OwxwgFLrMYvr4 yvDsRtyDCEB7q7lvDQDy5mp98l5fJfusozVaykRKWixL7/h+RNufFinrzhDkU2cwUjBp QSrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=fGtAJ7cd5go6wyETHTHTaMuUUEp60ZYPfneqg3UyK7M=; b=inAsSUtMBokqZTSdjM8vRBdPVJt+gkELiQ/U6ALs4N4DooehXhiwSQ4c4tzACy9xsq m+ODLH+l44Ei1oWkwluZbCU3i93RcybBdLgZldSctBxuUzrzqXQoe9eGIRsXXNG7Wgv3 /q+2tPy3bf//4zbnZQrOLAEYDVD28gXLbujf1p14IX0ueY0AMraLBFkvD3qTQjApMS7A yojfQKsrjMZB9jFvt4J62CzFrlOW7+ZeBWpjB5JS+Ikv/YxDY9KXR2x1qmnfCsPiCuNk UOUEnX2JRo20ZOH6kDPJ35T+C0gtJ0t76OxovJKuvjQtPOErA/tEwVntXfhbOTURksRK yKVQ== 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 g59si360734plb.302.2018.12.06.06.29.23; Thu, 06 Dec 2018 06:29:55 -0800 (PST) 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 S1729692AbeLFO2V (ORCPT + 99 others); Thu, 6 Dec 2018 09:28:21 -0500 Received: from mx1.mailbox.org ([80.241.60.212]:16128 "EHLO mx1.mailbox.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727737AbeLFO2V (ORCPT ); Thu, 6 Dec 2018 09:28:21 -0500 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id 4E7CB49B92; Thu, 6 Dec 2018 15:28:18 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter02.heinlein-hosting.de (spamfilter02.heinlein-hosting.de [80.241.56.116]) (amavisd-new, port 10030) with ESMTP id 1MlHGAHWIwrm; Thu, 6 Dec 2018 15:28:12 +0100 (CET) Date: Fri, 7 Dec 2018 01:27:57 +1100 From: Aleksa Sarai To: Florian Weimer Cc: "Eric W. Biederman" , =?utf-8?B?SsO8cmc=?= Billeter , Christian Brauner , linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, luto@kernel.org, arnd@arndb.de, serge@hallyn.com, jannh@google.com, akpm@linux-foundation.org, oleg@redhat.com, viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, dancol@google.com, timmurray@google.com, linux-man@vger.kernel.org, keescook@chromium.org, tglx@linutronix.de, x86@kernel.org Subject: Re: [PATCH v4] signal: add taskfd_send_signal() syscall Message-ID: <20181206142757.4gon5afqd7uphyqk@yavin> References: <20181206121858.12215-1-christian@brauner.io> <87h8fq7s84.fsf@oldenburg2.str.redhat.com> <87pnue6bp2.fsf@oldenburg2.str.redhat.com> <87efaun587.fsf@xmission.com> <877egm6a7v.fsf@oldenburg2.str.redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="lfqpejtbalk45dmv" Content-Disposition: inline In-Reply-To: <877egm6a7v.fsf@oldenburg2.str.redhat.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --lfqpejtbalk45dmv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2018-12-06, Florian Weimer wrote: > > Floriam are you seeing a problem with this behavior or the way Christian > > was describing it? >=20 > My hope is that you could use taskfd_send_signal one day to send a > signal to a process which you *known* (based on how you've written your > application) should be running and not in a zombie state, and get back > an error if it has exited. You can detect if a process is a zombie via the procfd by observing "stat" (the state will be "Z"). Personally I'm with Christian that we should maintain compatibility with the rest of the signal APIs -- sending a signal to a zombie is a defined (though no-op) concept. I don't understand why sending a signal should fail in this case -- a zombie is not the same as a non-existent process. If we need to have a way of checking whether something is a zombie (other than through "stat") we can add another method (or flag if it has to be atomic) in the future. And given the complexity of doing it, I'm even less of a fan of doing it in the initial patchset. > If you get this error, only then you wait on the process, using the file > descriptor you have, and run some recovery code. >=20 > Wouldn't that be a reasonable approach once we've got task descriptors? I think taskfd_wait() is something we'll need eventually, but I don't think that making taskfd_send_signal() do something that is contrary to existing kill(2) interfaces (making it so that transitioning to it won't be seamless),=20 What would the error be? ESRCH would be _very_ wrong, given that it would confuse the two states (zombie/dead-for-real) and would lead to weird cases where fstatat(taskfd) succeeds but taskfd_send_signal(2) fails. --=20 Aleksa Sarai Senior Software Engineer (Containers) SUSE Linux GmbH --lfqpejtbalk45dmv Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEb6Gz4/mhjNy+aiz1Snvnv3Dem58FAlwJMe0ACgkQSnvnv3De m5+6LQ/9GHVZuwPuP7m7j4zUzFp6qTNTWTbcM9P2/LEc0HwfgEL2UnsBDjOOZTpD DYJjmeQkO5bfwGoccamM39pKEWmETFOC63dY9wd6faZNtvbNy4p87HRC834/SBfB 0rPgUNO+G9667tdm/0O3wIYoVO9fRmK+52rP+oo4kvKh+0DZr4j8UB3KbTmz7CTN 9g6b5UslN6ukxPs/g5l8Ma2udEuxxfwiWRly0Gg9Cv+Vtm4or0lcQDV0eBTl0Ly5 5/Cgq4sTwNXmiSvECT+1P2mwAu8uNSoqxzzR+IWyN0a1tX4JLGbRuDYRWmflMnGw no/SYlj3ekza7rJ7SxBrWqbyTFduq2ZGyt8S7AHKPaeSPjIuS3jmBQOqU80ngGrh 5+L+AbCqa5S+HZWpoOAPxhkFPJFCN+ulgK9Da6b253C9MkA93I94NOWod6Ao9MwR DJmXWwfgcjZ7YykC9To6Oke/wyUQzy06YI8Ne0uAT2iUFjfuE4CMSTars0KbqL7i 991HXFzi7VpgNXA52JnyX1XMwxJVa1Muq2xHNRQW/HyOAGp68ZedJezWJsuKQxyf R22dqRnfjEYMePVn9eQdjyCy6qrpjDa/hem5T4xF/cCw9Km4pAijYMbzK0g2M/ol Y1VmNRBXsw8Y1xTqpj79sUbgI2GPHzvFQ37Y4ec7NbAEpZMSfFs= =KvNk -----END PGP SIGNATURE----- --lfqpejtbalk45dmv--