From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by sourceware.org (Postfix) with ESMTPS id 9F27F3858416 for ; Thu, 2 May 2024 13:08:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9F27F3858416 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9F27F3858416 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=145.40.73.55 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714655299; cv=none; b=rMOAsU8MXl1IJkat72JRObtA03ygr6+HlHVhyv5uVz+ecOUxpL9l44jzvj1g9KveZqyMOh+AclwxlAb7f1jicrvhczA8iI6HwHb36NlnE75mcmlYD13yc0L1bgl9eSQ4DYT+W5J0ko7znmnDhjMkQL8N0C7S4XuVgw+ZjfDL55I= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714655299; c=relaxed/simple; bh=k5KOH2RHPzrvgy56nRKWhjolv43Wf2+3vKU6xOlkz+o=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=u3fO/t6TqfPmLSghzCVpwq9USVKpabs+LlHKS7+4h9LRjX0gW5vfkcPz+Rdrx03FfrGZa5TeyqR/rS4JcNkSDUb5VxG6Qgv2kozK7B+0wX5C9D5o8IPBRa0M+ZWuqgzdPdkSqw49FYPdRRE6J1o0nBo8w1r35BjhNHNc1knSRW0= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 61AA8CE14E8; Thu, 2 May 2024 13:08:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F122C113CC; Thu, 2 May 2024 13:08:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714655291; bh=k5KOH2RHPzrvgy56nRKWhjolv43Wf2+3vKU6xOlkz+o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LEP+fCslkDiCXBWoib3/vE2nA3zyjK6T+9NcChZhIsb6rZbSukPaaVSgmsKsOuxXN WQwftKhXPr1O7EK/iL6q+hVLYS9eOqu0p+g2nMYiCrS9swQbWDgY7caLHOQRvNj7e/ KxkMpehYRJsise3+duVhFqC6I037uK07URGiQtnoqm1iovoxMT21W6wqEXKPkAw0KS TZ08f/sm49oxZee39RLL/FwgScmwgJzGAvWPq5pMl3SY85/TNK52iEq8A65bUnIutZ SadWpDqsn2hVh9fuQbRORxcFa+h2gHP9Q9omgD+37Z4j8zlJMqjhV36J7l0TzwPVG8 U7TXOZnC21frg== Date: Thu, 2 May 2024 15:08:02 +0200 From: Christian Brauner To: Florian Weimer Cc: =?utf-8?B?QW5kcsOp?= Almeida , Mathieu Desnoyers , Peter Zijlstra , Thomas Gleixner , linux-kernel@vger.kernel.org, "Paul E . McKenney" , Boqun Feng , "H . Peter Anvin" , Paul Turner , linux-api@vger.kernel.org, David.Laight@aculab.com, carlos@redhat.com, Peter Oskolkov , Alexander Mikhalitsyn , Chris Kennelly , Ingo Molnar , Darren Hart , Davidlohr Bueso , libc-alpha@sourceware.org, Steven Rostedt , Jonathan Corbet , Noah Goldstein , Daniel Colascione , longman@redhat.com, kernel-dev@igalia.com Subject: Re: [RFC PATCH 0/1] Add FUTEX_SPIN operation Message-ID: <20240502-notversorgung-unerreichbar-2b2d434194cf@brauner> References: <20240425204332.221162-1-andrealmeid@igalia.com> <20240426-gaumen-zweibeinig-3490b06e86c2@brauner> <20240502-gezeichnet-besonderen-d277879cd669@brauner> <8734r0o81v.fsf@oldenburg.str.redhat.com> <20240502-sporen-pirschen-039688cd9efe@brauner> <871q6kmra1.fsf@oldenburg.str.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <871q6kmra1.fsf@oldenburg.str.redhat.com> X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Thu, May 02, 2024 at 12:39:34PM +0200, Florian Weimer wrote: > * Christian Brauner: > > >> From a glibc perspective, we typically cannot use long-term file > >> descriptors (that are kept open across function calls) because some > >> applications do not expect them, or even close them behind our back. > > > > Yeah, good point. Note, I suggested it as an extension not as a > > replacement for the TID. I still think it would be a useful extension in > > general. > > Applications will need a way to determine when it is safe to close the > pidfd, though. If we automate this in glibc (in the same way we handle > thread stack deallocation for example), I think we are essentially back > to square one, except that pidfd collisions are much more likely than > TID collisions, especially on systems that have adjusted kernel.pid_max. > (File descriptor allocation is designed to maximize collisions, after > all.) (Note that with pidfs (current mainline), pidfds have 64bit unique inode numbers that are unique for the lifetime of the system. So they can reliably be compared via statx() and so on.)