From mboxrd@z Thu Jan 1 00:00:00 1970 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 95FB621770A for ; Mon, 23 Feb 2026 11:14:16 +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=1771845257; cv=none; b=Gzz/CVsufHMhUzlFlP9xaIGNfcc6durMbyTwVq+4lx/HUcAa1ihIFXwQJdOux/VLsOyZmeRXbQAzoyTpZ3ADX6hGFGuKH+jpZN3tb0SNxbcpwgLIz4hBI8ee0oJHTYAoLO8It2IuKzPQGUNZZ8utv/5FcLPIoAaPbwHbG2j0EzQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771845257; c=relaxed/simple; bh=Yd8cq7jhxBQD+nJL1cG4S1BqInpFBTV54XgA03pK4Xg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=gaG3s/y0D9aeiO+xe3nj95TfiYkDzRWTDasxN8H0fZdNr8zNyAd/PnceHlYryndVdghuORRgkiqirKy+OOuwev/818CMQktYoz3ZnDi3WUXEa6seM1cyA0xxzjJiT48qPH20lKfzxSm1+Cs1xQw1w0NakpwHNOTRAbsYkJralks= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=hUEE585+; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="hUEE585+" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1771845255; 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=kvSyvbvHe9TBXfOII9wq8hqN2AGyxv0aQKYcsksqKFg=; b=hUEE585+qVc5AXNt7ODaxHKpETNHn7TJCOn0doIuAEsOvO2l7sWZ4Lsk951Ken5mISaeEc nqH8FjbGXl7U6Z1ZjPd069+gwh5P/oxJR1fY9yYyTwKCFOTyrrzaVYYNgnWSsfoTOZQdDk TQrhxThFp6NywaEGOBlWAwg62JhBdSQ= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-661-zVZfYIWhOqG3B1y3NUeS-g-1; Mon, 23 Feb 2026 06:14:13 -0500 X-MC-Unique: zVZfYIWhOqG3B1y3NUeS-g-1 X-Mimecast-MFC-AGG-ID: zVZfYIWhOqG3B1y3NUeS-g_1771845251 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C15F2195608F; Mon, 23 Feb 2026 11:14:09 +0000 (UTC) Received: from fweimer-oldenburg.csb.redhat.com (unknown [10.44.32.187]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 534EC30001BE; Mon, 23 Feb 2026 11:14:01 +0000 (UTC) From: Florian Weimer To: Mathieu Desnoyers Cc: =?utf-8?Q?Andr=C3=A9?= Almeida , Carlos O'Donell , Sebastian Andrzej Siewior , Peter Zijlstra , Rich Felker , Torvald Riegel , Darren Hart , Thomas Gleixner , Ingo Molnar , Davidlohr Bueso , Arnd Bergmann , "Liam R . Howlett" , Lorenzo Stoakes , Michal Hocko , kernel-dev@igalia.com, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, libc-alpha Subject: Re: [RFC PATCH 0/2] futex: how to solve the robust_list race condition? In-Reply-To: (Mathieu Desnoyers's message of "Fri, 20 Feb 2026 18:17:36 -0500") References: <20260220202620.139584-1-andrealmeid@igalia.com> <0d334517-63ee-46c9-884d-6c2ae8388b87@efficios.com> <67be0aa1-2241-43ef-aa01-a89ced26c8f6@efficios.com> Date: Mon, 23 Feb 2026 12:13:59 +0100 Message-ID: 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.30.177.4 * Mathieu Desnoyers: > Trying to find a backward compatible way to solve this may be tricky. > Here is one possible approach I have in mind: Introduce a new syscall, > e.g. sys_cleanup_robust_list(void *addr) > > This system call would be invoked on pthread_mutex_destroy(3) of > robust mutexes, and do the following: > > - Calculate the offset of @addr within its mapping, > - Iterate on all processes which map the backing store which contain > the lock address @addr. > - Iterate on each thread sibling within each of those processes, > - If the thread has a robust list, and its list_op_pending points > to the same offset within the backing store mapping, clear the > list_op_pending pointer. > > The overhead would be added specifically to pthread_mutex_destroy(3), > and only for robust mutexes. Would we have to do this for pthread_mutex_destroy only, or also for pthread_join? It is defined to exit a thread with mutexes still locked, and the pthread_join call could mean that the application can determine by its own logic that the backing store can be deallocated. Thanks, Florian