Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10876129ybi; Thu, 25 Jul 2019 06:25:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqxCZ0fdPhOZKYEjZPOCSMCr0vs1eKMAoPHSUPAFfLR6IwNhvgzGxshlZwRYX7jAYJm2YVy6 X-Received: by 2002:a63:ee08:: with SMTP id e8mr32348061pgi.70.1564061143190; Thu, 25 Jul 2019 06:25:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564061143; cv=none; d=google.com; s=arc-20160816; b=b+goVItUMiJJIjcoVRgcVA4Acds1mdGgVIg5VtHw76t6QYjDCkQCPHaXHBwjL2eCVD JJEn0Zv3zAGbS5TI9iQF9f303x4zxQnIYSPdKeQUuSR7p50BhUhA3ZOR8jCEhPlU7o7J zhMv/BeRl8H0cH2g0s+9Fi+Zpx72ZDtoYaRcMEErNui4GOnohVb2goek8iJYAF2RbBcB zSMq8+4d3EvC4o9bntfEwpdXSOZxXs86FLEZd1WJgdiMFsFlBSj8C74ocb7JLXJGRXaX ySoiioRHkAXDvtxwh/ZAslM7Lqn6Atw4IAcxDT6TGeiz6imrdZb1vulqWgporlWR4qv6 BRXw== 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=xg/jPeKKTB739DC4K1Kn5i6nMiOCPP3yYS7XnqJJUR0=; b=RDIhrvH/GMVUpZU4T3DNhM0Ee44Tw1KUaI2sC4/PusI3zaJp05B0UyOS4Vg/zbvsqp HME71jh0nWjFyb7gu8bg+m3mmqj4ktUDmFWO2vzhi0vrbO3XgNTJvlyBasIvOba2AF/m 53bqOeCTKgSzTAUKJpyqXmwA4Nn22CtIVDLQJpDAxgb3ig3NjZA1U4q5S5Z6pMUlC8Ag baSf21WDS+QdfsqHtcQjpVBbDAurQIP8gqf7ragSjFKhgLuqf7eL2Gyo4k9oP6TGnC+V 6r/0Tx7o4kP9G64ESAvA8PKyM+exmNKDdQY0TCdjECWtyfOb1RVDQ03VEMbd53NyILco 4lrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brauner.io header.s=google header.b=DZ2Ni7t0; 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 h15si15588347plr.23.2019.07.25.06.25.28; Thu, 25 Jul 2019 06:25:43 -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=DZ2Ni7t0; 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 S1729838AbfGYKWB (ORCPT + 99 others); Thu, 25 Jul 2019 06:22:01 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:38684 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727402AbfGYKV7 (ORCPT ); Thu, 25 Jul 2019 06:21:59 -0400 Received: by mail-ed1-f68.google.com with SMTP id r12so14937791edo.5 for ; Thu, 25 Jul 2019 03:21:58 -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=xg/jPeKKTB739DC4K1Kn5i6nMiOCPP3yYS7XnqJJUR0=; b=DZ2Ni7t05/jQ93QmmC1R/YHMhpDaH8fwuJhAj4qWCViaKIFm+SJfKoKs4xeUSlf6RS ailFXEETYnNGKz+7klPXoF8lDxcqG89449URMDPBWZjGELL7cSyACtnBbD4QDxEv4DoY Vn7vJM73S9XdMTu9iKTl/VdhHTOPfXZTu92TnJvcAWj+umf2IJhq27wK7ddcHkcgAu9y mqrSYlYtMqqPZ7K3fJP+EFG9XjL32ozVRHam37ox6u7p+F/nzOG6Vss7s/WlKrCfsT6W tjCKCSkaCnKbS7sl/aZOHoTqbO5jqslxO5EDaNiyel8F4szFy3JP3f0qL8zonVM1mpTl 2dig== 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=xg/jPeKKTB739DC4K1Kn5i6nMiOCPP3yYS7XnqJJUR0=; b=UWyFGjrPbP1ixF6OE8BH9suelOWEPxZ2ScxJCpIGY6ZlmnQ/4mxFBItYW3Ox1HDA7C ordoKqklkZVROF7uxOP2p1R4HcLK4rYJdAuqbRocjzv02aaLWSYrLHsUpjIGYZW0d/3N wyjRX9TXx1FodBwj7R6B3iX9fvlkgcPF+LnXv4hdf8lK+op01mXyb5yh/CaFjZ638pLZ yDcQiBibmQAhsS1EjtkY08lo6o0vR11T+o6i5tEfG4oYPS0cH9n68yRwV0JM+jibCZ6J 6jBrTavxhIP+gA0pJAU4qOQnPvxTv5Qbdxl+UwfDtLrFfOj6Kr2TwkiM4ltSGhnyeSf3 JZJg== X-Gm-Message-State: APjAAAVG74XzRUE+WSS7jlyveimbYCnv62q6mm80SpqEBy3ikxg9l/k6 NWghyeP7jFJdirLhJVn3iJ8= X-Received: by 2002:a50:ad45:: with SMTP id z5mr75231854edc.21.1564050117987; Thu, 25 Jul 2019 03:21:57 -0700 (PDT) Received: from brauner.io (ip5b40f7ec.dynamic.kabel-deutschland.de. [91.64.247.236]) by smtp.gmail.com with ESMTPSA id uz27sm9729326ejb.24.2019.07.25.03.21.57 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 25 Jul 2019 03:21:57 -0700 (PDT) Date: Thu, 25 Jul 2019 12:21:56 +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, linux-api@vger.kernel.org Subject: Re: [PATCH 2/5] pidfd: add pidfd_wait() Message-ID: <20190725102156.nqnngsrb6dwmyztb@brauner.io> References: <20190724144651.28272-1-christian@brauner.io> <20190724144651.28272-3-christian@brauner.io> <20190725101626.GD4707@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190725101626.GD4707@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:16:27PM +0200, Oleg Nesterov wrote: > On 07/24, Christian Brauner wrote: > > > > +SYSCALL_DEFINE6(pidfd_wait, int, pidfd, int __user *, stat_addr, > > + siginfo_t __user *, info, struct rusage __user *, ru, > > + unsigned int, states, unsigned int, flags) > > +{ > > Oh, I too think that P_PIDFD makes more sense. I have already updated the patch to introduce P_PIDFD. > > and could you explain in the changelog why? I am not arguing and if > nothing else this is consistent with other pidfd features, but if you > are parent/debugger you can't hit the problem with pid-reuse, unless > you races with your sub-threads. One of the things is that later on this will allow us to make it possible to retrieve the exit status via waitid(P_PIDFD) for non-parent processes if handed a _suitable_ pidfd that has this feature set. Maybe even - if safe - make it possible to wait on a process as a non-parent. And some tools just really want to do away with pids completely. Christian