Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp11087673ybi; Thu, 25 Jul 2019 09:45:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqz/ls2MfVRfysu26jGnN/zF+0heEuZ5uNwbeYfoOD+gbgM8tvXPAupnx3Be67DMCEGfd8AU X-Received: by 2002:a65:6288:: with SMTP id f8mr81630755pgv.292.1564073144644; Thu, 25 Jul 2019 09:45:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564073144; cv=none; d=google.com; s=arc-20160816; b=n7ht63SkJLDAxJl4/VjSvvXdwZDtUjEtk5sO0zbF42jZrPAXUeRG9tXOrl/y3UGoEe w3KFptrPxJ33nUu5J6XxLKqGNfbovCXRVna8sfuHiU16l+VokfcymRgMpBXFujC5k9kW 0qA7/lvu7OkcLZ1495KZPrWMukPjy0b542K1DHIk8kA37fVd2DjtB1YD0ZXzAjZA52uv 1eH8BhoGf+Jg9u/Dop+VLV7elTTU9Ujwx6eTxIfBD+0RkpomvMC7A/90n7u6AygXXhoM pAhowxwoipI4HdY+jujgYrXUycOnhzsilYAdtjq0ThwvuXu0KtyInNzaUFuwuBBaustY UzwQ== 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:dkim-signature; bh=BGhGjGkqx26zhb3e825tZSpGwxL7pQ8J7DYvtVZD7+w=; b=xjyFwHl1Lv/b0E0zleWb4gfeQcsgeJKWFuiX2SlXgQaBooJojw4VnzB0vkoQpw0FNG k2xkeuHMhbp+aztfjnbm9w/eaDpNViItk1jJ4jEx57N8r+kefwF0ky/vAib8PTsH4oh9 /U6r2BSUjvTM2Bcf1TV4PkcChVbNJVNAcixoAYv0Nb5aF009F/lr3bBAHuzCrnStJgKJ fwozA3Zj9mwBj4oyfT0iUKqRXvORb6IgrOc1TMr37VTqloQvj8xZeSBlmEm/pKvyph5+ IejCxfp85TGSLf2wZY++Gbr0cg/PRlzhnLkI7dYDYGKKQgqNhX1bXEd9nXgj13bogRUp xYPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brauner.io header.s=google header.b=E7cMYjZW; 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 k11si17120537pfi.3.2019.07.25.09.45.28; Thu, 25 Jul 2019 09:45:44 -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; dkim=pass header.i=@brauner.io header.s=google header.b=E7cMYjZW; 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 S2387587AbfGYKkK (ORCPT + 99 others); Thu, 25 Jul 2019 06:40:10 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:37846 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726390AbfGYKkJ (ORCPT ); Thu, 25 Jul 2019 06:40:09 -0400 Received: by mail-ed1-f65.google.com with SMTP id w13so49816552eds.4 for ; Thu, 25 Jul 2019 03:40:08 -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=BGhGjGkqx26zhb3e825tZSpGwxL7pQ8J7DYvtVZD7+w=; b=E7cMYjZWN/V237c49DX1e1nzbZ7WGWjx92/9T6eNC4xybWF7WXMj1evR+ivXq2tL5H 0GnbONt83ID2YRsieGlvSKvIwMafD8wcKllyceOWXSyZfZMsjWSHV0JwGuNtpztUs7gC pmPNu/IPzicrKQCUrkqzGtJ680YYHVdqn72Eg7r06RZBjhnD0wC2ybAVPhK51GHG0c4s wvXJJqFora1gEsEsE/Gtl8hZ5hqS3LpkC1zGJyROYf5G/sqX50dXyFJx5BhKGbMWrXyJ G/kUfYSlq4+ZV8aVOWAQ+C8/wgz2aKF48MqSKKZQkIgGf9bSwRm8lbYz9CAmW8budzjS AiUQ== 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=BGhGjGkqx26zhb3e825tZSpGwxL7pQ8J7DYvtVZD7+w=; b=TnYN3BNMBgnq7kNgxAbTb4K54WDixWIDa1dtOKa5xoePg8LLVapv1S/S3JargfkOKY ZHdqbKtMIKcM/nXpRfg8NltW23XRATdpUb/GwQzRa0AXB1HRHYMIRg+hlJqNKFT0nFz3 GEtIFWpsGJnnpr2xYlWjtNg7UajHLEznX1AeKFYFwrEt+acYT8uZqctCYwh4XAVKDdKT M2tc+keqtFGX+gs7d0hAK0c1TfqnzLvFnzi3G71CWuc10F3SRTdgwi0ZKTo8sCIVw9vY YRTO9Lv+vcMBkt4tZ47JD+swTGeVk2kMyEjgu6JicRt8E9m4Kac4yIrtmK4pjiOZQR0Q R63Q== X-Gm-Message-State: APjAAAXOgW5Qc5VbKLxlHjs0rjnrsWY/tg074chl69q9cQtyEwyagu8B Zcr5+MPnBOrGW1MBGkCg+pA= X-Received: by 2002:a17:906:68d0:: with SMTP id y16mr67503047ejr.161.1564051207887; Thu, 25 Jul 2019 03:40:07 -0700 (PDT) Received: from brauner.io (ip5b40f7ec.dynamic.kabel-deutschland.de. [91.64.247.236]) by smtp.gmail.com with ESMTPSA id p43sm13593173edc.3.2019.07.25.03.40.07 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 25 Jul 2019 03:40:07 -0700 (PDT) Date: Thu, 25 Jul 2019 12:40:06 +0200 From: Christian Brauner To: Oleg Nesterov Cc: linux-kernel@vger.kernel.org, arnd@arndb.de, ebiederm@xmission.com, keescook@chromium.org, joel@joelfernandes.org, tglx@linutronix.de, tj@kernel.org, dhowells@redhat.com, jannh@google.com, luto@kernel.org, akpm@linux-foundation.org, cyphar@cyphar.com, torvalds@linux-foundation.org, viro@zeniv.linux.org.uk, kernel-team@android.com, Ingo Molnar , Peter Zijlstra , linux-api@vger.kernel.org Subject: Re: [PATCH 4/5] pidfd: add CLONE_WAIT_PID Message-ID: <20190725104006.7myahvjtnbcgu3in@brauner.io> References: <20190724144651.28272-1-christian@brauner.io> <20190724144651.28272-5-christian@brauner.io> <20190725103543.GF4707@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190725103543.GF4707@redhat.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 25, 2019 at 12:35:44PM +0200, Oleg Nesterov wrote: > On 07/24, Christian Brauner wrote: > > > > If CLONE_WAIT_PID is set the newly created process will not be > > considered by process wait requests that wait generically on children > > such as: > > I have to admit this feature looks a bit exotic to me... It might look like it from the kernels perspective but from the feedback on this when presenting on this userspace has real usecases for this. > > > --- a/kernel/exit.c > > +++ b/kernel/exit.c > > @@ -1019,6 +1019,9 @@ eligible_child(struct wait_opts *wo, bool ptrace, struct task_struct *p) > > if (!eligible_pid(wo, p)) > > return 0; > > > > + if ((p->flags & PF_WAIT_PID) && (wo->wo_type != PIDTYPE_PID)) > > + return 0; > > Even if ptrace == T ? > > This doesn't look right. Say, strace should work even if its tracee (or > one of the tracees) has PF_WAIT_PID. As in if (!ptrace && (p->flags & PF_WAIT_PID) && (wo->wo_type != PIDTYPE_PID)) return 0; Sure, we can allow that. Christian