Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp304356rdb; Thu, 8 Feb 2024 06:34:00 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVLCOGrpXRjQPeAVjLjzR/nam88CHdtKlq7DPpIbVS9MaVfRFle+RMbQs37LAIQsJ49BD2E5EDrFEcuM63RBqPmWA1ohYc48igXVqyehQ== X-Google-Smtp-Source: AGHT+IHRqwQdU3++AByS1LZ9CCr6u5KgfAKkISOwEYrhYqRyrOqyMvRw0IFCKYsux+/5+YfUx3yu X-Received: by 2002:a05:6214:d03:b0:68c:c227:4211 with SMTP id 3-20020a0562140d0300b0068cc2274211mr1887468qvh.8.1707402839743; Thu, 08 Feb 2024 06:33:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707402839; cv=pass; d=google.com; s=arc-20160816; b=TwpOvfY1dDR6UWwbfYsgSC7x7jUtbJA4enSJ97PIJjlWDv2obHW0td2l5dk2pYUoe+ VC5o41k2FuZEl8JXrYxRP46caVME/t0HWE5wDw2aA9FFZL5jQm9gJjbgaZt6d7CZG+Aj YLaFCHAMDszEcfeZm3dN7AdDbGjK6K+3TDVDv0CyyKLUSlrWlkKYMVM2UawDHxREcGQE hbNFW2mUENxChxQoOGSKAiJyuo1PO04bcO8c3zDFCRSuFfzTstTPzvBB3zFs3vkoCO/M fWQhakhygqBVa8ZiAyjpcWmDSWVRvbtrrOYCGzEIysVNvrE0qr79S2lTgkRcFL+yX2Si QIDg== 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=mrlvQHOloPhyxoUUWRwETCCFJIhbEkgK6jMWT7/2B7Q=; fh=J5sAc/n7wn1s5XYBNp7ojGsb6oe3wRjnGDTprSNp29s=; b=aaDGxP5ori7SEvKde+Rrqnc5I2d8rVPnpfR6+NVqJCPTeQaH7M92M3p/K9gEE56uSe EYORRRkqDiWo8R/KVFQWpYjArFRvDDWP2y/7ziCuWNbhefMnWMTof9hvl1NE+mZVuKlb vDi+NvZQc4nmTgfnoOGangNi/dcvg1qNd+QNTqpUOBYRuOB12uQSIATL1VqV9kn+bMt/ bGHbOnQBrygKyyWmgRYyOwb8FakP0k5iX59duSqr6x0c8CyA5n0DQkx52qbIaplQJhvg I38Zf17zIjZPCufWDDFAgyeriz2smMTtzhDKiMvg0VigzGme8hHLTVBozwL9x+bdK8hz hbng==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Cehdgtf1; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-58236-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58236-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCUZaqfobEN9WYhEDCTyH3bLGORd3VJS+vtmmwgELlmm8AeunJtjYCzww1wwu+A+x1kzouCzg9JRVJSbrxhnm7CrEF/e0hS44VgXARuMUA== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id gs1-20020a056214226100b0068ca99368cesi115635qvb.230.2024.02.08.06.33.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 06:33:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58236-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Cehdgtf1; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-58236-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58236-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 7CAD31C23EDD for ; Thu, 8 Feb 2024 14:33:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3E5D1149DFF; Thu, 8 Feb 2024 14:33:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Cehdgtf1" 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 669CF76025; Thu, 8 Feb 2024 14:33:51 +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=1707402831; cv=none; b=fOxGZFrQDHjOnbWt92Uw1XNAmtXnd5wpjLnLH9AWw1NrRKK/zxg/Fx4UUJihkJhKyZzPusufGLmcb5UOPoiBVSW9as1B4nJ0glxjwMUvA+MZICybuiSV2aCOE3NUzpILiXDhknyzxUdLYY3mMEsv75jbHXSyTj9ZBGLeFymGk0Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707402831; c=relaxed/simple; bh=imQeAlzmuuCpUlPeugyY3TXa127oRZG/o03+jkL+eI8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hm4pl8TfFP1r+zCkJNbyE3jNBX9T7ozMLgiPp1q6i/84RcWkOj8097DAwqbX7osYud4iRf0H/xrNfNl5rE+GmCAG2fC3DWcIvhel1BKh9rtJ65vXdp6ScgY/ewJYteaj3k6q47jmZPZiTCxHUoRWMuHkQ9SyMfo72DRWxf/P6wg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Cehdgtf1; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 313C8C433F1; Thu, 8 Feb 2024 14:33:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707402830; bh=imQeAlzmuuCpUlPeugyY3TXa127oRZG/o03+jkL+eI8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Cehdgtf1f6DVbbYyI8KzEC12Wh0tYzj43aKJ2e4GndjsvgjQWBnWpoOWbbqazA2q3 8Yd8DehhPnjtfQY954h12WuZzCclgcOWgjoNALNrqZ9DzVd406ZLGSzEweM+dMSUnd n8RpdMa90YaH4C5Q5QauL8Kev+rJPvTnlj4xsyJ09Ckl3SlyP3sRPHUMnNr7N5czyK GryUeW7xIfyQcDd/o9SczRHxKM1pRiaw5wXTZmxPDmueSGhZfxIYUPtXjoByKUEwhR mljSLFeR9t9GW2fdgq0dBBi8WJ0r4VHXe8b8x1qqdkIbUMbYQgTAYw5fpCXfX94319 c90mH8RTOuRRg== Date: Thu, 8 Feb 2024 15:33:46 +0100 From: Christian Brauner To: Oleg Nesterov Cc: Andy Lutomirski , "Eric W. Biederman" , Tycho Andersen , linux-api@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] pidfd: change pidfd_send_signal() to respect PIDFD_THREAD Message-ID: <20240208-babybett-nachjagen-ed354d2192f8@brauner> References: <20240207114549.GA12697@redhat.com> <20240208-fragt-prospekt-7866333b15f0@brauner> <20240208140610.GE19801@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: <20240208140610.GE19801@redhat.com> On Thu, Feb 08, 2024 at 03:06:10PM +0100, Oleg Nesterov wrote: > On 02/08, Christian Brauner wrote: > > > > I would also suggest we update the obsolete comment on top of > > pidfd_send_signal() along the lines of: > > Yes, but... > > > + * If the @pidfd refers to a thread-group leader the signal is thread-group > > + * directed. If @pidfd referes to a thread then the signal is thread directed. > > No, this depends on PIDFD_THREAD only. Sorry, yes, that is what I meant to say but obviously wrote unclearly. I mean that if pidfd->f_flags & PIDFD_THREAD then it's thread-directed. That's what I meant by type of pidfd. Not type as in PIDTYPE_PID in struct pid. > > If it is set then the signal is always "thread directed" even if @pidfd refers > to a thread-group leader. > > Otherwise the target task must be a group leader and the signal will be > "thread-group directed". > > Right? Yes, please feel free to update the comment!