Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp388536yba; Sat, 20 Apr 2019 04:52:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqxFH+TmSIftZQQ66juAUdNSnpiEJAGZVTOlGfZqDBOLr6TvLsklP3A3M5nndqWyhFZxGBBR X-Received: by 2002:a63:4f52:: with SMTP id p18mr8933509pgl.333.1555761162803; Sat, 20 Apr 2019 04:52:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555761162; cv=none; d=google.com; s=arc-20160816; b=IkwnbTQKogQpVtPtFbYu6nf5J2F5Bk6CxAUEMcnMRXtX9P5Q42ojcEEhM45qiq29EW WLZLy9O0LwmZ2OPop7M08OQB5a/T51nTPWLMwtkCGZ011ntWzo6/bTxeI85Wbhn1BSLh QCAYbyQBqe1dEJ+wKiZ9UYH/xcrzh5dbjjc9GqF/X9eV2WwmYdd6+SUuX2wweMO2Ylu+ oHdfieyrxNqHoMsMW6Rw4wtHx5JxBvwG0vZJi7r59/Kz4VAd8vkaxblEduUJbLIxDmyU cEbM2sdhZz6cvxUaw/lyxQknFhEhlgAbGOzUP74gbfXDEt4dDPEgH9kMb/a7QWiiRlFQ aUfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=SB5xMLkRdPpXQFLSTIFW2MuWKzI7NDV0W588WdQ0eYg=; b=ib48WQLHsABFjqU+QdW7SfBiSnIsiXuaMAdaEeQypqW/vekBzDYTNKHXTFJAy4ebp+ 175vsSMgP2fwnv8lPt/Ap6dAjzp4mhAccZE0Kc26jUuc9ABQY9h2OYigMl8IAH4f6hsA iytZaF0HLdnz6vWmo5D6U6Zqlecdmhcu040J2j+D9VkVUO8JIWWG80pILRTGK7ZTPRlo PQx3Dvs3izuM9JO7z8MKMPGfX1XvAnlnmHCEelpAFjIE9Qsrdvg7wd4MBxwb4EHNYAwT xKk8EhUBtp06shaSgc41o2qRUoMAv1UZsE5ieatVHb2V+b5KE1b9uPFRjC0L+rGTbttw HsrQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p15si8021353pff.225.2019.04.20.04.52.27; Sat, 20 Apr 2019 04:52:42 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728263AbfDTLvj (ORCPT + 99 others); Sat, 20 Apr 2019 07:51:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59430 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726179AbfDTLvj (ORCPT ); Sat, 20 Apr 2019 07:51:39 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 64D7230B2550; Sat, 20 Apr 2019 11:51:33 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.43.17.38]) by smtp.corp.redhat.com (Postfix) with SMTP id 8E312600C0; Sat, 20 Apr 2019 11:51:27 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Sat, 20 Apr 2019 13:51:32 +0200 (CEST) Date: Sat, 20 Apr 2019 13:51:26 +0200 From: Oleg Nesterov To: Christian Brauner Cc: Joel Fernandes , Daniel Colascione , Jann Horn , Florian Weimer , kernel list , Andy Lutomirski , Steven Rostedt , Suren Baghdasaryan , Linus Torvalds , Alexey Dobriyan , Al Viro , Andrei Vagin , Andrew Morton , Arnd Bergmann , "Eric W. Biederman" , Kees Cook , linux-fsdevel , "open list:KERNEL SELFTEST FRAMEWORK" , Michal Hocko , Nadav Amit , Serge Hallyn , Shuah Khan , Stephen Rothwell , Taehee Yoo , Tejun Heo , Thomas Gleixner , kernel-team , Tycho Andersen Subject: Re: [PATCH RFC 1/2] Add polling support to pidfd Message-ID: <20190420115125.GC17468@redhat.com> References: <20190417130940.GC32622@redhat.com> <20190419190247.GB251571@google.com> <20190419191858.iwcvqm6fihbkaata@brauner.io> <20190419194902.GE251571@google.com> <20190419212002.GB44851@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Sat, 20 Apr 2019 11:51:38 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/19, Christian Brauner wrote: > > > Just for the exit notification purposes, the states are: > > if process has exit_state == 0, block. > > if process is zombie/dead but not reaped, then return POLLIN > > if process is reaped, then return POLLIN | POLLHUP > > Oleg was explicitly against EXIT_ZOMBIE/DEAD thing, no? He said so in a > prior mail. Has this been addressed? Yes, please don't use EXIT_XXX codes, nobody should ever use them except the core kernel exit/wait paths. For example, EXIT_DEAD means that the task auto- reaps or its parent had to temporary drop tasklist. Just check ->exit_state != 0 && thread_group_empty(). Note that we need thread_group_empty() only for the case when the task is traced, in this case we have an extra notification for debugger which can confuse pidfd_poll(). And of course, everything will differ if/when we will need to monitor the sub-threads. And btw I don't think it needs tasklist_lock, but lets discuss this when we have a new version based on pidfd. Oleg.