Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp448520rdb; Mon, 29 Jan 2024 07:14:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IGcr4djgGOXs7VpmFr7VLMs3vU6bRKV8ctcjQBuuCeighwka7EGLJVUhep6361oNJVPQWYF X-Received: by 2002:a17:90a:8a17:b0:290:7711:29db with SMTP id w23-20020a17090a8a1700b00290771129dbmr2106869pjn.39.1706541282943; Mon, 29 Jan 2024 07:14:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706541282; cv=pass; d=google.com; s=arc-20160816; b=ZTNwuzGT/Cvb16fGVFa6X+KwDr5KGqZMKZH7YmYEJLqfxe0Xoz13A+YdN2WosB2Xeb wz4r/S1O2iSm8uGMWmi4PoFX5/mv2RlpZAJQNZmd3HjKyF/Xo4MxkRbAHosDED3vLOvQ ItP8iRx6ePgsFEUNXuvqCXb5lB8ugPE6OUFf43FAw6cGhBqGIErj8ay3pRjVH9H6KTxz aruogn6iQMsHiGu+PoVZFuTHwS2eXLSQzvIEMp0KK8BA+GDtCEpiudkTAiByzGIiZIQG xKKAhP2ecgT70CvvPwwnGrSDLSm8OVtoKq6zG23zmHJiHi2zpWChS6MfnTsp8RJSf8ZZ feZQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=m+AnGyD0GgtuEYH5WONuM7mr12TcMgnb2ev/bwIHRZY=; fh=5lTTCeCqx4/XokEtSiEFYpRspw0/kdZZ1eSEE5qtKY0=; b=wA++XqJNtLpRSsCDAZrSZLvvo29a4MC3LNEDs4xAeJu/4rr0U97IEzDmX0JK3DAMu0 jvK1VXnVAuR3Eeef8tJ6/KYZXz76xkjXVbkR2QBcP9k2Gczb12j0cJrNsj+dqnIjaRzb JZ9KKPf1B4k2oV2Vd8X9wOjLLfEtXNaPIqEkBH0QQoBNooGtQqVSCKmhnfk2jsvOrim3 e/G/evO9Ca0EX3VkkxjiWobm6sL4fl47otRHdo/3OhJczxlF1oY1dsmst3e5qnTNIg5z px9oC3NlG87PW3bTr1Bg6rB/1iYCZDmEjM5lZD66KPOUPXx/csqxyFhyolAiIAtn5bwp pGcA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=r8zmKtt8; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-42971-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42971-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id x4-20020a17090a9dc400b00290443272e3si7826244pjv.105.2024.01.29.07.14.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 07:14:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-42971-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=r8zmKtt8; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-42971-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42971-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 9741D282317 for ; Mon, 29 Jan 2024 15:14:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6F6DD153512; Mon, 29 Jan 2024 15:14:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="r8zmKtt8" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 986281534FC; Mon, 29 Jan 2024 15:14:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706541274; cv=none; b=NB5lGFioET63vVyQnLYedKQrz+gy1j/wRMisADI58MGphpswhORAfcFuwEWSVrh/Tj2USNo0o9rAwW3ptRx9IymkxbbEGbiuAIuNKbQ6VVZESVzHvDEFbkiVicJ3QOim+gYtXnqqViZYVCIub7fIdkO8ozQjlnEdvqSIwuJ3efE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706541274; c=relaxed/simple; bh=AQDzrA2EHtRyGDHRWwJhVOioutXaThI2sgVCDXaZxvI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=aotLFHWNZmjLZPWVITzHuzPI9J/r8Nsf40TpLUwTD/xHT36IcFUMwduTY1Xw7MkcP9AaB+quTqYPyO0C3qJZkQC0PpXc3WK7ZthT5sW1gRL6HBKW3e1+/DRLX/7kf/NGt9+itm8gVbrEP3q1iAjNs4XmxjwuN7nJMzAGnjMvH3U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=r8zmKtt8; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17C7DC433F1; Mon, 29 Jan 2024 15:14:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706541274; bh=AQDzrA2EHtRyGDHRWwJhVOioutXaThI2sgVCDXaZxvI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=r8zmKtt8lW/obv/Usya0+bk7UUBloZ+dobiV5pMDR79mYucLHzwIE6oWSCsK06rlf E7qs0pTaK5eSihonnhV1zhhgzhcN0wxsqI1BDhYLsgjmOl+P3L87EAwoHGvNCj+lQS aeyN+rU2DSC/32GIygFfquvronbiwZVJnQ8D2HXlfXwsAgX9psJhbePsMQAoxbt1aK QcUML5GM/9h6KdMyJjXfTtxLYCXcrM/s8t0mTgQmx9OgBWthwQ9k1b+nfD2AvuoVxM tacPf0YKJYeDuDlFQKuxSQ5xaz5Fzt9KtR17eA5xPP+GfKeIFTCWTjj3vHH7W5s1jN jaVCUalrtP6Yw== Date: Mon, 29 Jan 2024 16:14:29 +0100 From: Christian Brauner To: Tycho Andersen Cc: Oleg Nesterov , linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Tycho Andersen , "Eric W. Biederman" Subject: Re: [RFC PATCH] pidfd: implement PIDFD_THREAD flag for pidfd_open() Message-ID: <20240129-autark-spachtel-c37fd31383cc@brauner> References: <20240127105410.GA13787@redhat.com> <20240127163117.GB13787@redhat.com> <20240127193127.GC13787@redhat.com> <20240127210634.GE13787@redhat.com> <20240129112313.GA11635@redhat.com> <20240129-plakat-einlud-4903633a5410@brauner> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: On Mon, Jan 29, 2024 at 07:31:35AM -0700, Tycho Andersen wrote: > On Mon, Jan 29, 2024 at 02:41:11PM +0100, Christian Brauner wrote: > > On Mon, Jan 29, 2024 at 12:23:15PM +0100, Oleg Nesterov wrote: > > > --- a/kernel/signal.c > > > +++ b/kernel/signal.c > > > @@ -2051,7 +2051,8 @@ bool do_notify_parent(struct task_struct *tsk, int sig) > > > WARN_ON_ONCE(!tsk->ptrace && > > > (tsk->group_leader != tsk || !thread_group_empty(tsk))); > > > /* > > > - * tsk is a group leader and has no threads, wake up the pidfd waiters. > > > + * tsk is a group leader and has no threads, wake up the !PIDFD_THREAD > > > + * waiters. > > > */ > > > if (thread_group_empty(tsk)) > > > do_notify_pidfd(tsk); > > > @@ -3926,6 +3927,7 @@ SYSCALL_DEFINE4(pidfd_send_signal, int, pidfd, int, sig, > > > prepare_kill_siginfo(sig, &kinfo); > > > } > > > > > > + /* TODO: respect PIDFD_THREAD */ > > > > So I've been thinking about this at the end of last week. Do we need to > > give userspace a way to send a thread-group wide signal even when a > > PIDFD_THREAD pidfd is passed? Or should we just not worry about this > > right now and wait until someone needs this? > > I don't need it currently, but it would have been handy for some of > the tests I wrote. > > Should I fix those up and send them too on top of Oleg's v2? Sure, I don't mind.