Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp1606128rdb; Sat, 10 Feb 2024 08:53:05 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVmdnddfNvkNk71v1nu6KnRQyFPAHLDU3SLYM10qgFnReMXB6/0Z8FbMibR9K5JuHZHdjaJe+bRyaOcxQXpMyH64FbsaCDMZDb3uDnDug== X-Google-Smtp-Source: AGHT+IHzxvM8hSTknDVKW4NmVpugmAaSwN/j/kdUdcky7pyNUZvSEbxbl5MFdo3n/CfEAcMfQLzk X-Received: by 2002:a05:622a:14cb:b0:42c:3472:ad4e with SMTP id u11-20020a05622a14cb00b0042c3472ad4emr3872659qtx.57.1707583984849; Sat, 10 Feb 2024 08:53:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707583984; cv=pass; d=google.com; s=arc-20160816; b=WRFaVpylXXCydfBwQqZ3cegvl0/3J3eGP3/xuDXxpCEiP55H9kkhJ5t6g7qbSQomwP u+kAzfZJbLijDpeVht20+C8dYOzd+N6H/P39yiygd8JrwBIX04IbezQ1dChKZdRRP/OX WvDDnQEpBIdWKOp6/xOUGVgcJuJi3HYaRE63cwmYojupX8bRFQENLFWOHTclB73hbGed Difvm7N5dwLlOrSlTzOVB4k4nUFnA2w53WTAJQ9jf2Eo/y6N4Pc36/FGQGGg4e6qx7vd T+e5w88hmqf/60hlOLy7AM9Tabjq54P742T+wHHUuyXuFRtRIk/Z48uNXR/VxX6JR+9c yrqA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent: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=/JHi9CwFInkSQeN39Fd9gZFUZtv3HNk0+Aar5uXCB3Y=; fh=QvUMUnt4nK2nVtIq9CriHgTwjL1u3ooClO6/sPUwFRk=; b=gFRg81ZHCpdr47lQu9XAgTKLkF0ohHCxgk3S+ufm6AovAFVzfflppXTreozWGpsS+u s6ADWvSTltns6dMiLDDMgaRUYQCxX/jbSQF8CVeWsZ/YtYE6s/kS9s6cRUrbrmB55I4x MynhhoNh5kJIEcxYHICKFLGcsiw/kBmex/IJU7CFeJnr97imIt4Joyn2kgJeEfP/r3NV b663/ex/XfezIbL3I1ZjZIxApQErnsppYrnmhjMKmK4vFkXNpFl9JrRk0cuJL56t8dMh tADHtUoQlLk647ytwo6KwdYsS/BVSKPcWeAtiSaZ/7LaExbjrcws6Ma1sCUQNTmM5XNl t6ag==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bQPe1VQF; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-60480-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60480-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Forwarded-Encrypted: i=2; AJvYcCXX3X6qNsSs/fh1YjHFS0Jy6rqdz+m1NWIA1V9sOcu08mm9CXQ46hMHw2e41Zvm/8Mb9N1jKCU2u73SHkvPTJf4ursCqPhuuCthYnXmrw== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id k4-20020ac81404000000b0042c592b68ddsi3949504qtj.314.2024.02.10.08.53.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Feb 2024 08:53:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60480-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bQPe1VQF; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-60480-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60480-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 7C2D51C21B39 for ; Sat, 10 Feb 2024 16:53:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E4D135CDC3; Sat, 10 Feb 2024 16:53:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="bQPe1VQF" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 414395C908 for ; Sat, 10 Feb 2024 16:52:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707583980; cv=none; b=tvQRdvCuU1c4ZLMuECdx9Dvxaf1rr9CZbNzKsthDW8i5meX/oJYGsGmWIw0ypgGcycQ38G5Zp6dmQ3h6eErVfYLZ5Rum0MUWWAW11/Gy8eBS1UTRzuRtJ4/86FBb8jlx/iU7Ib5sCiYGnbBa7jQjYN+udoA/fY9UxB6lDeAiBDI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707583980; c=relaxed/simple; bh=0JWG02bhsd1Y1pLGIUQfKn5oHH6Uh5NErnSElNVvr5o=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=OctcWcaJQ1QzIHxakZaPT/8EWTXblU68kX1LVtjq3Bad4z4hRFlwPFNZnWeuFbEqz3dlwnB1ABGVwWL1leu/h3AL6TLMgG92ckK6qlBIsSlbL4pAaiAxeXlXmbDgAGoSDjRMLn4BpuBWxZ6WoUFkWa14xFQJiuybvs7EFHjWHuE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=bQPe1VQF; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707583977; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=/JHi9CwFInkSQeN39Fd9gZFUZtv3HNk0+Aar5uXCB3Y=; b=bQPe1VQFKyexV/Odx1cykmjjcN9wdEb7WKEkSbbNZdmPAaeBz1gbNV62nLrCecfvTd/DyF EDjoZg7F4TaGCCb2a2qtjVbayLoL5z+ztwhNpkJ7Mg2dU9JSH5/3XHm4V0wRKdNs6v5Cfi 4tf+lvJRrqtwcBMrEIklru3sJQgKAHM= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-299-sw7yyYNVMHS622X-z7BN4g-1; Sat, 10 Feb 2024 11:52:52 -0500 X-MC-Unique: sw7yyYNVMHS622X-z7BN4g-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1C23C185A780; Sat, 10 Feb 2024 16:52:52 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.224.28]) by smtp.corp.redhat.com (Postfix) with SMTP id 70E561C10C0C; Sat, 10 Feb 2024 16:52:50 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Sat, 10 Feb 2024 17:51:36 +0100 (CET) Date: Sat, 10 Feb 2024 17:51:33 +0100 From: Oleg Nesterov To: Christian Brauner Cc: Andy Lutomirski , "Eric W. Biederman" , Tycho Andersen , linux-api@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/2] pidfd: change pidfd_send_signal() to respect PIDFD_THREAD Message-ID: <20240210165133.GD27557@redhat.com> References: <20240209130650.GA8048@redhat.com> <20240209-stangen-feuerzeug-17c8662854c9@brauner> <20240209154305.GC3282@redhat.com> <20240209-radeln-untrennbar-9d4ae05aa4cc@brauner> <20240209155644.GD3282@redhat.com> <20240210-abfinden-beimessen-2dbfea59b0da@brauner> <20240210123033.GA27557@redhat.com> <20240210-dackel-getan-619c70fefa62@brauner> <20240210131518.GC27557@redhat.com> <20240210-chihuahua-hinzog-3945b6abd44a@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=us-ascii Content-Disposition: inline In-Reply-To: <20240210-chihuahua-hinzog-3945b6abd44a@brauner> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 On 02/10, Christian Brauner wrote: > > On Sat, Feb 10, 2024 at 02:15:18PM +0100, Oleg Nesterov wrote: > > On 02/10, Christian Brauner wrote: > > > > > > The question is what is more useful for userspace when they do: > > > pidfd_send_signal(1234, PIDFD_SEND_PROCESS_GROUP)? > > > > > > (1) They either mean to signal a process group that is headed by 1234. > > > > Yes, this is what I had in mind, see also another email from me. > > Simple, clear, and matches kill(-1234). > > I went for a walk and kept thinking about this and I agree with you. > It will require that 1234 will be a process group leader but I think > that this is ok to require that. Yes... but I am starting to understand why you mentioned the new open PIDFD_PROCESS_GROUP flag... perhaps we can do something like this later, but this needs more thinking. > + if (type == PIDFD_SIGNAL_PROCESS_GROUP) > + ret = kill_pgrp_info(sig, &kinfo, pid); I guess you meant if (type == PIDTYPE_PGID) other than that, Reviewed-by: Oleg Nesterov