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=-1.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_PASS autolearn=ham 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 3A566C43381 for ; Mon, 1 Apr 2019 16:21:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D89AA21473 for ; Mon, 1 Apr 2019 16:21:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554135674; bh=2V/Ko7PyNJhIDy+yWZwaYRj3fj95SNnYqlq0HYIobZY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=QLxIJEANDyeOs/KLDMlQgQdhUi28G0EssS5ZGKkv7b5X1GQM7WVV7BHxx2G5ktOle iQiiFWBujlN12SyHOVGPgSuiTi9TLHQOS7IAkHr91kR3lxPqBYkh7Sbf8j789djMVY 7b0Cy1L/IwtD6QnoRO26NW3zJoAEY5sOTC8k4uaE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728557AbfDAQVN (ORCPT ); Mon, 1 Apr 2019 12:21:13 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:39467 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726854AbfDAQVN (ORCPT ); Mon, 1 Apr 2019 12:21:13 -0400 Received: by mail-lj1-f196.google.com with SMTP id l7so8737673ljg.6 for ; Mon, 01 Apr 2019 09:21:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=PrygaNWnDryni1ERH41cFwgQicTFKFc+tb7/PeD2atM=; b=Nc9ot7kgr5Wnyws3ntu/9l9X0TejONtrYeAwrslYZsvTM1m3DuvDkC4aJ7F9ZLzmHC oWfLq1vCH8JuktU2b0G2yFQJ/96WLOnfoUPMXt/ULaSkLYqmxfhHlVw2J7EnnxNBviwS msT4XkikFVtNmWUZhi7izBE/mmDpS9ubSD49A= 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=PrygaNWnDryni1ERH41cFwgQicTFKFc+tb7/PeD2atM=; b=DN/R/BeJvqSlddDp/xu78RIUccMBe8kq18JIwei6ZJUIdrmbRVaEA/oxx8QXzDxsSO wZywzUe7tppT+YY80whDhRAgC8cS2E5qwzZnMl8IFXdS9UzDJNNlu7M7fwtZbziN4VJr iM9oZ4hxeiAX6DBNfxuQT7LyezB0ZzQnK6+vfMoTZy6s8pbFMhGVNQPvQjCcpToFGj/y W4GuzBeVthuUzgfY3Yx14Z3G3JgF/4TVpDv/wqZ8RsiUNmP44Pv3ggc0FMtcLPChVv3x Mm7T6B8HtAPF1/VqZJrezx8Tluke8orzvVsOVo5jlLIhhPFQ3j2oy/DYiHlCw6kyND5p bARg== X-Gm-Message-State: APjAAAVe1Ot1xNbTV17mR0lvIf8RahyFB/MiIiFjAeP7QA4CbwY08C8l jxt5fKw83ELNlymHAAnBxl6LUq41g0c= X-Google-Smtp-Source: APXvYqwrC0E5nhqv+SYAHDfrk/fW+zGiZiHJfFYxOs7nXIAdM3zUjgmBTkdj6rsO3v4YGZYnjkzHjg== X-Received: by 2002:a2e:1311:: with SMTP id 17mr14120365ljt.75.1554135670547; Mon, 01 Apr 2019 09:21:10 -0700 (PDT) Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com. [209.85.208.181]) by smtp.gmail.com with ESMTPSA id v10sm1933556lfe.3.2019.04.01.09.21.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Apr 2019 09:21:10 -0700 (PDT) Received: by mail-lj1-f181.google.com with SMTP id j89so8760031ljb.1 for ; Mon, 01 Apr 2019 09:21:10 -0700 (PDT) X-Received: by 2002:a2e:8316:: with SMTP id a22mr35528351ljh.171.1554135316678; Mon, 01 Apr 2019 09:15:16 -0700 (PDT) MIME-Version: 1.0 References: <20190330171215.3yrfxwodstmgzmxy@brauner.io> <132107F4-F56B-4D6E-9E00-A6F7C092E6BD@amacapital.net> <20190331211041.vht7dnqg4e4bilr2@brauner.io> <18C7FCB9-2CBA-4237-94BB-9C4395A2106B@amacapital.net> <20190401114059.7gdsvcqyoz2o5bbz@yavin> In-Reply-To: From: Linus Torvalds Date: Mon, 1 Apr 2019 09:15:00 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 0/5] pid: add pidfd_open() To: Jonathan Kowalski Cc: Daniel Colascione , Aleksa Sarai , Andy Lutomirski , Christian Brauner , Jann Horn , Andrew Lutomirski , David Howells , "Serge E. Hallyn" , Linux API , Linux List Kernel Mailing , Arnd Bergmann , "Eric W. Biederman" , Konstantin Khlebnikov , Kees Cook , Alexey Dobriyan , Thomas Gleixner , Michael Kerrisk-manpages , "Dmitry V. Levin" , Andrew Morton , Oleg Nesterov , Nagarathnam Muthusamy , Al Viro , Joel Fernandes 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 Mon, Apr 1, 2019 at 9:07 AM Jonathan Kowalski wrote: > > With the POLLHUP model on a simple pidfd, you'd know when the process > you were referring to is dead (and one can map POLLPRI to dead and > POLLHUP to zombie, etc). Adding ->poll() to the pidfd should be easy. Again, it would be trivially be made to work for the directory fd you get from /proc/ too. Yeah, yeah, pollable directories are odd, but the vfs layer doesn't care about things like "is this a directory or not". It will just call the f_op->poll() method. Linus From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Torvalds Subject: Re: [PATCH v2 0/5] pid: add pidfd_open() Date: Mon, 1 Apr 2019 09:15:00 -0700 Message-ID: References: <20190330171215.3yrfxwodstmgzmxy@brauner.io> <132107F4-F56B-4D6E-9E00-A6F7C092E6BD@amacapital.net> <20190331211041.vht7dnqg4e4bilr2@brauner.io> <18C7FCB9-2CBA-4237-94BB-9C4395A2106B@amacapital.net> <20190401114059.7gdsvcqyoz2o5bbz@yavin> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Jonathan Kowalski Cc: Daniel Colascione , Aleksa Sarai , Andy Lutomirski , Christian Brauner , Jann Horn , Andrew Lutomirski , David Howells , "Serge E. Hallyn" , Linux API , Linux List Kernel Mailing , Arnd Bergmann , "Eric W. Biederman" , Konstantin Khlebnikov , Kees Cook , Alexey Dobriyan , Thomas Gleixner , Michael Kerrisk-manpages , "Dmitry V. Levin" , Andrew Morton List-Id: linux-api@vger.kernel.org On Mon, Apr 1, 2019 at 9:07 AM Jonathan Kowalski wrote: > > With the POLLHUP model on a simple pidfd, you'd know when the process > you were referring to is dead (and one can map POLLPRI to dead and > POLLHUP to zombie, etc). Adding ->poll() to the pidfd should be easy. Again, it would be trivially be made to work for the directory fd you get from /proc/ too. Yeah, yeah, pollable directories are odd, but the vfs layer doesn't care about things like "is this a directory or not". It will just call the f_op->poll() method. Linus