Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1828563rdb; Wed, 31 Jan 2024 10:12:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IH2ZEyMxq7Ntu0s0Do5E0kZupE58QjdLnCnvj50Qmq5mv86+w9u1Yww8LVB0DWRh/3JsjmI X-Received: by 2002:a05:6402:64f:b0:55d:3d64:3ba6 with SMTP id u15-20020a056402064f00b0055d3d643ba6mr1840397edx.29.1706724750276; Wed, 31 Jan 2024 10:12:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706724750; cv=pass; d=google.com; s=arc-20160816; b=krFEfVHczeQ4TmsVfu/Bq+ER9wsAliW0TnlWMrcvu6hh20fb3eE8A9ZbRBwjyn52qH UFCACi2ZA1pgzDXy2gOrWk+oKYGKv+si6gHo3QRzC9QPQBEGAJQGOs9hdQjh+U0blRVR HQNMcmBhf69B81gERf1UcOjMVZTJ2myOht3KsBzZ7VcJebksItJfqVrAJhQnJvKT4rqk rqc9hEaDPlT/BxZB6wd9iDNagO147DdRTwkrlidrTlyPe40Sa/d9SvYxaekv8hHawWaI nfV1S/0QkgxzhF9OfCJQ6authu2g5yDZljlEDmF51OkozYs1rbLGwUqAVZAVBC3HSger qPyA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=GGA0Zqk+riY1KRG9vwSmf4Mk+lzwyAYBV9JiVffdUNU=; fh=TgZEEuOeUXB8/LA5casTri0YRDVODzDaQhlM6br+vmE=; b=BUURXMLLm7zP5S0LqVxeLFTFX2QOtyE/IqjymLjBs6vlJBV0yi/ZINyf0hwmqD8gHk HhGWzB9oTu4HvtwLplBe9B0JJbqgieobTXR1CnCTQdYlQT28GgyeXQyS8Ea8voDrbmYS cyp6EepzfWaYktYud/B7u9rQFYUUOSRdoqyA4a/dFM4t5nmOv4VPCFxrSzC/e44n0cB9 FiT1ldElx0ZlAwredxlKp2fLN0xHv0EtnXbPplX/hoeU55SDyOZVzyuBN6CcDCHtBlC2 r0wE6/iANFuwH3vpe/Ey9cyvxt1G9LLhqVXU3EB3Z+oCqtQ6t/K16Cnp8zVNxI6mRMH/ adbg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amacapital-net.20230601.gappssmtp.com header.s=20230601 header.b=zxA9Jx+w; arc=pass (i=1 spf=pass spfdomain=amacapital.net dkim=pass dkdomain=amacapital-net.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-46958-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46958-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCW27djGYbs73yD6t6NwwfJuxC8moBJeuDH30rseNnn/qkZfHptnjPmWFGUJuLaLWqETRwt/ZxFryA5f0brbR+nxjFrNvjajc/fndowpDg== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id d29-20020a50cd5d000000b0055f31752e02si2091360edj.464.2024.01.31.10.12.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 10:12:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-46958-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@amacapital-net.20230601.gappssmtp.com header.s=20230601 header.b=zxA9Jx+w; arc=pass (i=1 spf=pass spfdomain=amacapital.net dkim=pass dkdomain=amacapital-net.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-46958-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46958-linux.lists.archive=gmail.com@vger.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 9F3B41F23E2F for ; Wed, 31 Jan 2024 18:12:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9821412FF92; Wed, 31 Jan 2024 18:12:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=amacapital-net.20230601.gappssmtp.com header.i=@amacapital-net.20230601.gappssmtp.com header.b="zxA9Jx+w" Received: from mail-vk1-f169.google.com (mail-vk1-f169.google.com [209.85.221.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1538612CDB8 for ; Wed, 31 Jan 2024 18:12:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706724730; cv=none; b=QrdcxFaZcHOMDOZvd6+nOkRjdKbm97E4wMwwwP7140j6gCHNFVjrnp/72d7qd/t3Y449naocHpxBHaWksNvsu6CP864Xp/69jwLA1IOsYuUDk7vTJQQO+EGUiaXGYcPY/gxCGVtr/8883KzJQVWtgNX3DafDhT6ot1MTHcmOKhs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706724730; c=relaxed/simple; bh=STgTLQoskTh+8DR2hD5JRM99Mcrb+r/d7oGmIrhDbR4=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=onGOjwGKpamD7abiOIjDo4YFd6JvbIcvzGGkGYpzX3qEouEKKLy8UfoHkU+qj29qSq5m+mA5YAFCRLwS/tfVfsARxp11zD21vzt6I+eeBib3hL0ohg1qjJGMoQdfUYTx167ROpzu7VqlvQEJWNyoiRezRRbcXroZhcZ8EPkjh2s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=amacapital.net; spf=pass smtp.mailfrom=amacapital.net; dkim=pass (2048-bit key) header.d=amacapital-net.20230601.gappssmtp.com header.i=@amacapital-net.20230601.gappssmtp.com header.b=zxA9Jx+w; arc=none smtp.client-ip=209.85.221.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=amacapital.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amacapital.net Received: by mail-vk1-f169.google.com with SMTP id 71dfb90a1353d-4bd80b41cbdso34009e0c.3 for ; Wed, 31 Jan 2024 10:12:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20230601.gappssmtp.com; s=20230601; t=1706724727; x=1707329527; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=GGA0Zqk+riY1KRG9vwSmf4Mk+lzwyAYBV9JiVffdUNU=; b=zxA9Jx+wpq6y2kh29ntpvVAdBb2QU4pBsQOGILAlLsouUWTz9yIPv6Zwfa9fvAApBD 2mQm+H/KIwLWgzQ7qy69FcXVUbQvYMkqTzBhvRxI7LMszqkgMdF42tiISehaPC2jwdFH xst+II4syImd1pUKhpXJUvwYSk3sQgMWKcm56MX8e8DEVt/ZV8Dday9oL7nXnHC004r1 0vpWb0At0+7/DUaFVUgBrUmTmLhGSG5BT+Q/S1z8oR/rF+j45Wm5/rHJiLBO3/0BFw8W NXr4CWiUO1m0amm6KBcc2iCQvjK/3czBAWVpJKaQ9i3xU6nXS8CeD8+12/8iqcmbHwMV RSOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706724727; x=1707329527; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GGA0Zqk+riY1KRG9vwSmf4Mk+lzwyAYBV9JiVffdUNU=; b=FdcK0Ey3eJCPgcexRox9Q7HCVX2cpiGYuLHKOEAMmXwqoOsY5fZsqZxC0/Q4zQb6sE 83oDiCPjr7QJwFMVkiUfqlYGJWKk0i/GnHwqtdvZ8HoP7FAx1MCVlRXssLhFRhb1xm8G BtoQwdspWjLZXCwXrCu4kdPYgpPauRQq0zGK2WwH50uOodkzlOcBtkNEvNrMx2IJ0iVT YCBwXN1aBml/K0X0tietog19qebghR5l34tz2JUQ53HZ7inzOYEm1thBTNxP8905h4sv MGFCyFkLvS7kGBUjgn4QQSelTPXiZOCDAB7hvF/bQ7zCDqn4r+3RLV2CD5fktlI7a4I5 O21g== X-Gm-Message-State: AOJu0Yz04miJQa9O+2tK2BAl3xxO96NhHOiJCxfdwqL1n13OGw+LqXTu /9W8vP4hf80AquXtAqAzhstjvWv4m/zyh8K/hZF8LN3Tv2asQvgJI9dcUd+jFYoBGLarYgCrsdg P//O3UGQxy7BZiVaj1/q47qBGzkRozoOjjYCM X-Received: by 2002:a05:6122:c99:b0:4bd:3b1d:38b8 with SMTP id ba25-20020a0561220c9900b004bd3b1d38b8mr2470740vkb.1.1706724726988; Wed, 31 Jan 2024 10:12:06 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240125140830.GA5513@redhat.com> <20240127105410.GA13787@redhat.com> <20240127163117.GB13787@redhat.com> <20240127193127.GC13787@redhat.com> <20240127210634.GE13787@redhat.com> <20240129112313.GA11635@redhat.com> In-Reply-To: <20240129112313.GA11635@redhat.com> From: Andy Lutomirski Date: Wed, 31 Jan 2024 10:11:55 -0800 Message-ID: Subject: Re: [RFC PATCH] pidfd: implement PIDFD_THREAD flag for pidfd_open() To: Oleg Nesterov Cc: Tycho Andersen , Christian Brauner , linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Tycho Andersen , "Eric W. Biederman" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jan 29, 2024 at 3:24=E2=80=AFAM Oleg Nesterov wro= te: > > On 01/27, Oleg Nesterov wrote: > > > > I'll (hopefully) send v2 on top of > > > > pidfd: cleanup the usage of __pidfd_prepare's flags > > pidfd: don't do_notify_pidfd() if !thread_group_empty() > > > > on Monday > > Sorry, I don't have time to finish v2 today, I need to update the comment= s > and write the changelog. > > But the patch itself is ready, I am sending it for review. > > Tycho, Christian, any comments? 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). So at least that should be documented loudly and clearly, IMO. But I actually just bumped in to this limitation in pidfd_send_signal(), like so: https://github.com/systemd/systemd/issues/31093 Specifically, systemd can't properly emulate Ctrl-C using pidfd_send_signal= (). I don't know whether implementing the other signal types belongs as part of this patch, but they're at least thematically related. --Andy