From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 51395384B06A for ; Thu, 2 May 2024 10:39:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 51395384B06A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 51395384B06A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714646387; cv=none; b=hoMksEWcJQ5pXeeMs/XT3xnFeWQDpKMic4R6UlDEtnkKeeErmXF0FQclPzswanEtULG+6MqU3EFPfCSfpyV4ph2hYB32N90HIKkADPa7x6N1G+ZWB49VunZpbiB0dmRoDjzGxAwyiJM0NKxjFog6FtZ1hNV41zeXyh+xvvRcDMc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714646387; c=relaxed/simple; bh=s6FKwE54UFYNcw1jeMV5GJo5kZugtlV25ulBqGrd9nE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=dVbsuYzjZJdh/KR4fJi863uLbjzukx1Ot/3781/99AV8Qc1lqvrP+yL2IEEilq2emxZgbPh6EwPlOj0X5sb09ulI9jvsotCE223fn0KLQijhuZLhv+U8JxlQbftecvTmjpL85md0KpWJ4fdZOk4r7pyYtsqSsFGLH/683Et0UVg= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714646384; 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=ORypNU4Jg7o5BAaBkjAQJMzFWJt5/boPJ1mc2TGpTGY=; b=cxju5aEIY1BhOj+wJmDpRL34+9KwnjDWYNUkO8cOQniOyuA7JRVGxmbQ+Tsst7Taz5MUBZ qSu9nCAdLksbtPet5bwis48NClP30Fod8E4sUOObIiSRTGSH5QpzrF3RIi4HpEE7lKnLOp dUlr+sQkCIMvtmvnfbeiwYMz8TKUjZE= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-101-Wr_bK_1HPduzif-IY4Kl-w-1; Thu, 02 May 2024 06:39:42 -0400 X-MC-Unique: Wr_bK_1HPduzif-IY4Kl-w-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (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 4C0363820EA9; Thu, 2 May 2024 10:39:41 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.193.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C1D6AC13FA6; Thu, 2 May 2024 10:39:35 +0000 (UTC) From: Florian Weimer To: Christian Brauner Cc: =?utf-8?Q?Andr=C3=A9?= 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 In-Reply-To: <20240502-sporen-pirschen-039688cd9efe@brauner> (Christian Brauner's message of "Thu, 2 May 2024 12:14:11 +0200") 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> Date: Thu, 02 May 2024 12:39:34 +0200 Message-ID: <871q6kmra1.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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: * 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.) Thanks, Florian