Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1847249rdb; Wed, 31 Jan 2024 10:50:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IHP9RefvgW4iCoakK8qqYvB/o2sDXbnufnREYVVoKkTBunNlWqQG+2VHe5ySj+A9THkGGZP X-Received: by 2002:a9d:6301:0:b0:6e0:fd9d:69f0 with SMTP id q1-20020a9d6301000000b006e0fd9d69f0mr2268142otk.16.1706727000825; Wed, 31 Jan 2024 10:50:00 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706727000; cv=pass; d=google.com; s=arc-20160816; b=QTGG4wDG6hKpcNhyTFJq0XEaG5+GXnABade/NcvsTDodbKQxLK6XKXlwCXc+FluU54 njuApbhP04QSfkJKvgfZ1mgkfNoT4KrRrYLTJCCr2RNT0/yS2kUHjod+UGV59VdI7J45 4qQ0oOXHZZXeOdmasP/YHPgC5QAvYqkGvaR1VyZTC6qlTCyIqf8nOjhG7vc/5NEepZ9o V6Uog+LkJ1H+v1+V/Nmleg2YNZJ8TMRtyjtmxTiOswyWvkVeRpISvKVjhDD8SqPP7uyO 6vR7h00IBeStzY3jfaj0nwmjtsRFEZey/euqrx8yFVycptj6Rzgd67LvecjY1nwV5KuK ZdCQ== 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=l9U8CKXhwM8+HNsv/ZLK5nhFsmc+OFbd5U+w8VnN6xI=; fh=AbhJyc4J3pNhUW14gr5JbT44o8U6zq29/scvo7Lg3uY=; b=M57AdnIqeWGponmbtXXSGPjAZp7pSNz918ibvFNEXEbNIhgOKdQXcS6wb1pavjpnm7 cOCbrnZgFpQQxYOhMEgAxycwrcmB6QsD5PwcdsG4r17S3UZuJG6rhgTorF/HImEGkNav ASiuzhzRINF7p+8gFW1PKZjEUAvyLCZWBY6KC0GRbrLOYq57BOcS8/fYRPrOHD8jSWoM 9P5fuuubU9u49MlJAy1ZIeROuiI02kw8NKVCH77BRT5oJusOstP2oCR5r/uORd68J+0p 5ab9BbwHD3qn+kXOFIktgWP5YypmRkU1URLXuNhKEM80heToyK3I035/UtJgnza2cAlV rn4Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Ga4fhofE; 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-46984-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46984-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Forwarded-Encrypted: i=1; AJvYcCV51FBHf8hh3FVqnE2UelNCKZE0B4EBV18JA3QkapnvZCPIOhW9n6dU2mnZkB5NSTP2B0Nltgz7H3JLgvQZlreCu/QH0udpYsoVyZCq4A== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id o5-20020a05622a008500b0042a627d12cesi12824561qtw.616.2024.01.31.10.50.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 10:50:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-46984-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=Ga4fhofE; 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-46984-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46984-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 836751C22374 for ; Wed, 31 Jan 2024 18:50:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D7BCA20DEA; Wed, 31 Jan 2024 18:49:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Ga4fhofE" 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 621C11805F for ; Wed, 31 Jan 2024 18:49:51 +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=1706726992; cv=none; b=AVe0c3GAffPLxq3fYC04OlBv9bPBx1RRXReVR6kOUZ3OyBv3/++/6iv6/upOdI73GHL1vN0uvMx62L5g1cgGUKwKhdVECsz3J5Mwq7bw3EjN7g0lFKCr+ALOpczpCLi6aDp5c74ssEK3BZc/5T3f9Mc5G+hJyFNbN4EeQr2w34w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706726992; c=relaxed/simple; bh=X4u+dQV5QUMk/zja0MJJBmXhJnm57hYRFF/uFj0w7ks=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XxKFgR9Vss9sDwCW3013WycxFl7JQeo5yAHLQ0/k1D5hyWb/0TnUH6jcq0n0Xnqm1BEaOWqnE98KsguaLCN2F6o8SfC3wvjEnCZMTu3LFciTGI71pm6ujJLGT8SItwsvcWqTKv/e1Gz2WB+XEmEbw65H3iBJXQtvL07fVr1bO8k= 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=Ga4fhofE; 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=1706726990; 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=l9U8CKXhwM8+HNsv/ZLK5nhFsmc+OFbd5U+w8VnN6xI=; b=Ga4fhofEnPVXjp9X97TJddzGmYliEgFNASmI+Elp9wV5HoJsWxX1tupWrLnMNopu7kKe7U ucRRco3e50GfHABTMsdBWo7kUegFvhvLuZTSZcOOrtmsxFPeqKfzHZaVMRoq5RsMWVTOKt 8XmCKeJPIfxMRV98UlpJ4Yyp+fwys1w= 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-219-KU-iabKxMFWAVmHrBJ0N5w-1; Wed, 31 Jan 2024 13:49:47 -0500 X-MC-Unique: KU-iabKxMFWAVmHrBJ0N5w-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (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 76D6B1064C64; Wed, 31 Jan 2024 18:49:46 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.225.249]) by smtp.corp.redhat.com (Postfix) with SMTP id CAC2FC1ED63; Wed, 31 Jan 2024 18:49:44 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Wed, 31 Jan 2024 19:48:31 +0100 (CET) Date: Wed, 31 Jan 2024 19:48:29 +0100 From: Oleg Nesterov To: Andy Lutomirski Cc: Tycho Andersen , Christian Brauner , 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: <20240131184829.GE2609@redhat.com> References: <20240127105410.GA13787@redhat.com> <20240127163117.GB13787@redhat.com> <20240127193127.GC13787@redhat.com> <20240127210634.GE13787@redhat.com> <20240129112313.GA11635@redhat.com> 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: User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 On 01/31, Andy Lutomirski wrote: > > Right now, pidfd_send_signal() sends signals to processes, like so: > > * The syscall currently only signals via PIDTYPE_PID which covers > * kill(, . It does not signal threads or process > * groups. > > This patch adds PIDFD_THREAD which, potentially confusingly, doesn't > change this (AFAICS). Yes, > So at least that should be documented loudly > and clearly, IMO. Please note /* TODO: respect PIDFD_THREAD */ this patch adds into pidfd_send_signal(). See also this part of discussion > > + /* 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 know. I am fine either way, but I think this needs a separate patch and another discussion in any case. Anyway should be trivial, pidfd_send_signal() has the "flags" argument. with Christian in https://lore.kernel.org/all/20240130112126.GA26108@redhat.com/ Or did I misunderstand you? Oleg.