Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1043441lqm; Thu, 2 May 2024 03:43:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU6Jfxv7gUwWag2UzenXddWr6dXzP80L0SDsxtOazWb37ZSZeo4P1fJCpjlqACDbTCI0vAKgoV1z+iPs3tGGuZYFLpa/qe8SJI7WIj+Eg== X-Google-Smtp-Source: AGHT+IE3EGCz3yqod1b5tIP2GxfEqi0T1Si6nVBZPxJnI+iwZ3bcaXGGpWv5UUrIAjwJebOOMGRT X-Received: by 2002:a50:a6db:0:b0:56f:e585:2388 with SMTP id f27-20020a50a6db000000b0056fe5852388mr1184747edc.36.1714646580068; Thu, 02 May 2024 03:43:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714646580; cv=pass; d=google.com; s=arc-20160816; b=xfHe9p2lLA16NapCbT0ZijEgNuu5ukpYuI1Bfy50B+gXjSJy+DseICqtG70QVvW6Ku cgzzGp3ggOharoudfKJe687EMi/Uwv6qibH8VAIwkyGUKrvdS3gBWPww9+Hn4WRLsb7A QC7fNbxHrK85Iz0bYhP42Zgzg0bmAQlDd6PrVkFczgNnmjyJkbQfMf4kpu00WxAwO7/2 /vWNOM0SCNHB3yl9WQFbrG0pZcnlP7TeJK+dDCkFtTZhjRD9ULRlfXMI3nJq0JSrAol5 3MvEmoUN0pt5Qje+mBZFjFd9idVKh8u0iDFp5nWi6u3R3kOb4Rj/TzpdYp6z9mTY6aQY C14Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:message-id:date:references:in-reply-to:subject:cc:to :from:dkim-signature; bh=ORypNU4Jg7o5BAaBkjAQJMzFWJt5/boPJ1mc2TGpTGY=; fh=OI65AqW0EX885lSF41eHqjkhySbMCjaNVA+68JKqEdo=; b=ZdRl1OD17ZL6pljnk9JVecvlHaNBeCRXAzTTvjEdZ1vCFU1K9zbCpWR8lGtpfEd1uX kPCA6KNtLyRK9bVmiM+Y5x+uxTrHTdbCSIDIv1QDa+pF2f3w1+6yb8y/Sc10XATU51eF 17JCnXsHh57Iaar8AFw2LMQQfi9eWoFZ0EJb3ufyTGaAO3PpZ2kg/TVlHoyYxYon1Sd5 rxMFY6dBNJxg3DP/sagDzngIGV3kdEWeYcH21h3HnBP3VHpRNivB5573+SN4cpF/geLk jYx99xHfUYIAYh654zbikn98Kr1DWKoaksI7ekO7yzpY8POFRYaucAOIQ4ANAS9HVGiD 9anw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Gm/EWYj4"; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-166332-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166332-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id r11-20020aa7da0b000000b00572244e6e4dsi389425eds.480.2024.05.02.03.42.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 03:43:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-166332-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Gm/EWYj4"; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-166332-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166332-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 C917D1F2137A for ; Thu, 2 May 2024 10:42:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 457625FDA7; Thu, 2 May 2024 10:39:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Gm/EWYj4" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 E993C5F874 for ; Thu, 2 May 2024 10:39:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714646390; cv=none; b=oZ7FxGAYA3vYk05iaESMl2aS5T7FKYjWppU9Fts0X/whgks9Ly2S2udkKXJtU0F9itmEfJmYRaLN0mY15JemM958jBks7H8oaVr/paUg0TdDyymbc5cAeIcMHO5BGU2ufJdWjYrgmxWJXLLwcWP9OJVzu+ZfWCPwXRd5bzCxsKQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714646390; c=relaxed/simple; bh=s6FKwE54UFYNcw1jeMV5GJo5kZugtlV25ulBqGrd9nE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=F6ZxWRaq1ISs0BZ97oczIGhhk9QlfUhMhVkvJAu+5jm4hszTRjf5upCvUqLdfvwJqFmOwQ5hOLnrbte0A/BCyoldZ7jhAZRvbnwTtFe0mRI6kiNjeWVmSLeXf40S2rhbALn8MAJuNMpu97rk06/5dc9tyEYZC8XqA2fVSz/0hMk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Gm/EWYj4; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714646387; 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=Gm/EWYj4JH8R9WuxhgVF1/G1LvcF+npJ7okR66uA9qdLn0pxXBB9o+cpXYQqKEJ/ClaQvF ZYpsU7pmKfXuOpI87lq7JL6bCKXWaGGPme0OnRjXhlmaPDfcBWajEQARStfYGBM71x/uRc k8NN5RqXBtyTcD46NAzpt3I+B7Ho5lI= 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) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 * 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