Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp940290rdb; Tue, 30 Jan 2024 03:23:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IG4f6Je4S+EVzuCgGcGkAUQ+ZF39Jkok9pGVwBbZpHjYqKT4CVMdUxKWdjNMYlTlmVn2H3f X-Received: by 2002:a05:6402:3458:b0:55e:f71c:c47a with SMTP id l24-20020a056402345800b0055ef71cc47amr3564635edc.30.1706613833555; Tue, 30 Jan 2024 03:23:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706613833; cv=pass; d=google.com; s=arc-20160816; b=KaH9lpdmuGJt1knDeG2kyGzLlzWv03qcOwmZYMYwBjned7+iKs9L48Il+Q3gSH/PQI f+bHclbTJOn4dTYyr0CAxnNRR0JG+eLKTalneUVknMQ+od+7rteqhTFZ9X2Oc2ojRjPW J3z245RQpxUQ1PbRfnlWMUXCtjZ9E69ClZEeo8fLlAsWak+m0O6jIl8iU0fTbZPnrJ/p ENxQszKuDnT0IP/cAzLnk90BjsDDHGU5Le12am46YDgmZzTmnT9bWIoTn6A0PQm4apJC CFFWCRr1QcVWZtAhKu90hEd5xZDTsRtLYpL8m9eA2XLJFb9FC4HrV0y7byWJ374R2XUT g3Mg== 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=lbt6pqkTcAveDCu7SeGXeYjFEpyubx/pRHH7MqmCo50=; fh=ttd5M4oh2J/lSvqfHyfhVQGCXE2K4fyBxVoE/QtpyDg=; b=p0jtV5bRpQj0FQOHryl5Eap8zlsna8paJGnX4Wh9ExQFrK8bJpDrZENAWRtE1MS3pQ 2p61vq/oDSJ4wfyponHatcC1LurhnpBdBcLWgS3P6Yrqds+rb7LJaK4qejWX/MuvvUqw iTjFvhq/fJD5BMHSn4GVMCR3EqVn3TpfonKebIYSN21KlL8jlj/cVuUIcKoMTICSbkdF /mmInK+w61y0GWAx7IlqNS4VqnjojJU6yoZ5TpvgtOKda7KtOuaKvcBS56k5gV42tfS4 kxl7fsl7LzZJV9FcnfM+CxlrxYalv39ucTxnLhHlMK5rhVWAA6XeRuvD2h0BBnLX9qvQ QdJg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eFITeLRW; 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-44501-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44501-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ca21-20020aa7cd75000000b00559fda7bde7si4426474edb.561.2024.01.30.03.23.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 03:23:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44501-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eFITeLRW; 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-44501-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44501-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 50A821F21DD5 for ; Tue, 30 Jan 2024 11:23:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ED1A367727; Tue, 30 Jan 2024 11:22:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="eFITeLRW" 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 659AC679E1 for ; Tue, 30 Jan 2024 11:22:48 +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=1706613770; cv=none; b=oPzPksWVD7HGmtDZwuFf6+7bz3tbZ1Dm3YIFCBh08cwEZ59K34hCGFMLbs+IMpPKSgdh8cHz6OvShzSRxdod/i7CmNe8ULp9PwZ9TSaX9SNxJWLmdxNvFO6lurDvDC08z/zEjvHUb56iAcVqulv4GMfaYNxILvdgfaQx6+vOP4w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706613770; c=relaxed/simple; bh=X10Uv/kIYjCZ9856oEa7EqVQobF7EnFD7p2D/5ZYbuo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=IauXqJ0GeqvPntQJfCj9McbwHIyZoQ5xm/gqDWFpVifKFz9lHV96+Z5MRd8sOkMUE6GaG4xMP6iIrjeGhJIKLdkGmzKqcsYTc1jK0pwVVSQMpAirqd4NBzoSo1BQaUZCDNDtTkmh3SI7DhnzPG7efZn+SKkeBaEVcVGPQokLmms= 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=eFITeLRW; 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=1706613767; 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=lbt6pqkTcAveDCu7SeGXeYjFEpyubx/pRHH7MqmCo50=; b=eFITeLRWs3Tp0CLCzbhL10E5+J4RcCZhgK24xf+2/uNZFEvO67MSqjoaBvlx+Hp3Mi0YRp hb9lOK5oWs8B2DVgNkNlVV2ellyDKZdDmuV1v93oLDHRpuHhZgdO4PBVKRemeolDrcuQuz bfzFgatGVEEgk/JGj7nNguuU92zS+K0= 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-493-4AY0TIrwOE2f4qeWfBFE5A-1; Tue, 30 Jan 2024 06:22:43 -0500 X-MC-Unique: 4AY0TIrwOE2f4qeWfBFE5A-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (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 1B83385CBA3; Tue, 30 Jan 2024 11:22:43 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.224.237]) by smtp.corp.redhat.com (Postfix) with SMTP id 7239B40C122E; Tue, 30 Jan 2024 11:22:41 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Tue, 30 Jan 2024 12:21:28 +0100 (CET) Date: Tue, 30 Jan 2024 12:21:26 +0100 From: Oleg Nesterov To: Christian Brauner Cc: Tycho Andersen , 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: <20240130112126.GA26108@redhat.com> 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=us-ascii Content-Disposition: inline In-Reply-To: <20240129-plakat-einlud-4903633a5410@brauner> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 On 01/29, Christian Brauner wrote: > > On Mon, Jan 29, 2024 at 12:23:15PM +0100, Oleg Nesterov wrote: > > @@ -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 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. On a related note, should copy_process(CLONE_PIDFD | CLONE_THREAD) add PIDFD_THREAD flag "automatically" depending on CLONE_THREAD? Or do we want another CLONE_PIDFD_THREAD flag so that PIDFD_THREAD can be used without CLONE_THREAD? Again, I do not know, needs another discussion. > Otherwise this looks good to me! OK, thanks, I'll send v2 in a minute. The patch is the same, I only updated the comments. Oleg.