Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp3038531rdb; Tue, 6 Feb 2024 05:38:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IFuycI4cvTUb/gke+vZze7u42O9icMm1bAhxoKf+Nox1Z1jSqcmrILvvOJfi4CNN4eqdZRK X-Received: by 2002:a05:620a:6225:b0:781:5e3a:a85f with SMTP id ou37-20020a05620a622500b007815e3aa85fmr2237330qkn.17.1707226720126; Tue, 06 Feb 2024 05:38:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707226720; cv=pass; d=google.com; s=arc-20160816; b=RL9m/V1oviQPK3Q/R2YXYrWWHh//ZRADZMppXj3i16NOGSADTTiO1eA5YBVG4MKLXG HYVvJZHrVRzqxG+LEl/cq2/YAKTq7mw6O3XsooBTTJj3Z+/a8paReOwvgc5F2JWqZU1+ YjpuvC7nITSWkDH/RzwRc3yiXFE4W4m3dq1I41N4cDRXd+01N/FyobD+Pvuoj1GlxAy2 VvQS4j4u737z+HZCL+p0+m+ycIkfC27Qh+wSfVkBm1JLHisglbKGtY+PkaLVacaGqgBf UTLXxZ4WEBEWsad1PS3Dk37q2m6PXg1ehQECSLIGkFQ5qWuevpL9VQ1GV9cA1wh6A7Dw yMwQ== 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=QpB0DYn56ELY+uWSUJ17wSMYgAYAK38A42WduzKcwRI=; fh=GPdKg+CYWr4MHNEhG3Pemsj4UPNhWoSul0CmXNTcCgs=; b=TFs0qmLg45RqXXwWqYxrJbOeWkhDEF0GcRCMgVzYdfXXd3jXXRwOHBTN7OavyF4CKq 591uDtPluKd8N/Wr0BqE4Kik7JileG4cor10hMm5IvY5RO7yZQG3TcfkGLjTmz8jyJ6Y 0ZvpvM1jareVk6yBc3M83SvulJSL5KQ1l7geE8/8hr19Vrbgf2aRT07SbLeyCk2fgNdv c4qGXC4ksR+qmgaQCRaGeeyMfbFLY9uaqVKZvM1wA/M34sXyEdPsrHMTSGxQ50TV/onn 9L3WpHHUIbmZP78+Oud/V9RHrthk6/Srq6yDkFDwXqJJGH5TL9+gN7nxoC6kzMdSLsh2 OyQA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WbN7uTfZ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-55028-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55028-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCVHq6cm72v0lQ7wGzkJKHd3Zy2155rwH2SEmJtbRETE+txJjY8GjYgNlenK17A8o5bz0PbTWVFfNNzsGbEbr71jM1fpAZl9q3GAKBPKAA== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id o20-20020a05620a229400b00783fb5cf4d6si2237544qkh.614.2024.02.06.05.38.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 05:38:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55028-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=@kernel.org header.s=k20201202 header.b=WbN7uTfZ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-55028-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55028-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id D525A1C24967 for ; Tue, 6 Feb 2024 13:38:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B3F3F13172C; Tue, 6 Feb 2024 13:38:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WbN7uTfZ" 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 E1B5473195 for ; Tue, 6 Feb 2024 13:38:32 +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=1707226713; cv=none; b=nIE5s3Tsu733ayaECgg0QkMMbwRogFLoJh49k7JFZxQdgR8VrLoGBqftj7ilj9G0sZF9sK0xXYq4WcKClNt4G/kDYS6+8+brE6lKq1gWjIFX/07duDqyc/gcitjl2xgFHBSRy+aGeDMPLkdIlfAjW79RSe05I/55ijMqsevBAic= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707226713; c=relaxed/simple; bh=Fb1RR5YKjdb++HKdFCbp1Gw0EkAjp8M6VBIziUToSwE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UXWAB4EEUEW3JHniTCGOhJG+Ba/IOb4YzkTAy9lNuIl2bV+U/b5vkTY8tONjvZJBCoBE7Dg8O5NkxJLI+KYSXDJz+7idE9Sd4SrxrqXJRs6et/Bqy4RfIVRXyOHMsl2gWhVHHUDP0GeTbMraAOJBhL+oqnoStHNZ1Q+psPtacHs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WbN7uTfZ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17472C433F1; Tue, 6 Feb 2024 13:38:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707226712; bh=Fb1RR5YKjdb++HKdFCbp1Gw0EkAjp8M6VBIziUToSwE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WbN7uTfZXwr134Sf3PejpCzdftQv7Bju4pbmqRNmVB8cm0Si1/6QSOj7OpJVPVglf +TBuluksaWSHVZcwVRPJeAfgRPkxLYRma2Ds8NCDjvPOgoM0ZKm7IDwWi9lmaohYzf 3jKzja2+ibFv6rhPRBkriY/bRsv+diPEuOWFVZYPAt073JnKzAmvKMjuy3afg/JSrp vc4mFs55R/oiGViAyPi+e2M8dU5/9KsyEHHxn7moLy9qFOhj8n+05Bzq6hXd04j4zQ sQalc5QtlxCz52mgGI2DL+LhKDEm4y+zRP7gNyO3v2dLp8znwa6ObM/YElHCoB3FS5 m6nurpyFmEGkQ== Date: Tue, 6 Feb 2024 14:38:28 +0100 From: Christian Brauner To: Oleg Nesterov Cc: "Eric W. Biederman" , Tycho Andersen , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/1] pidfd: implement PIDFD_THREAD flag for pidfd_open() Message-ID: <20240206-beatmen-lehrling-440dc305b070@brauner> References: <20240131132541.GA23632@redhat.com> <20240131132602.GA23641@redhat.com> <20240202-helium-eurem-f63c0f9328c0@brauner> <20240205152241.GB15853@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=utf-8 Content-Disposition: inline In-Reply-To: <20240205152241.GB15853@redhat.com> On Mon, Feb 05, 2024 at 04:22:41PM +0100, Oleg Nesterov wrote: > On 02/02, Christian Brauner wrote: > > > > > @@ -2050,6 +2051,8 @@ static void pidfd_show_fdinfo(struct seq_file *m, struct file *f) > > > > > > seq_put_decimal_ll(m, "Pid:\t", nr); > > > > > > + /* TODO: report PIDFD_THREAD */ > > > > So I think we don't need to do anything here. Since PIDFD_THREAD sets > > O_EXCL in file->f_flags and in contrast to do_dentry_open() it isn't > > dropped. So userspace can already detect PIDFD_NONBLOCK as O_NONBLOCK > > and PIDFD_THREAD as O_EXCL. > > Ah, indeed, I didn't know that fs/proc/fd.c:seq_show() reports ->f_flags. > Thanks. > > > > OK, what about another TODO in sys_pidfd_send_signal() ? > > I mean, should I send a simple patch which changes pidfd_send_signal() > to use do_send_specific() if PIDFD_THREAD ? Or do you think this should Yes, by default the type of pidfd should determine the scope of the signal as discussed elsewhere. (And later we can add flags that allow the caller to change the scope of the signal. So that Andy's use-cases are covered as well.)