From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) (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 E380836CE1C for ; Fri, 27 Mar 2026 03:42:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.97.179.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774582977; cv=none; b=V666niG9FAMq0APBjm5ftTVC+EOVah20nVdMjEhVUCiaj4EID7lP5MMERXqc8qiHLrfIIbtwMBnf+RCF5BUu+EzKaMC2s40PSiWCGGcaRyRk+8pPTvM1BozVanNDai5etGL7JGBZmxoWz8ZBpJjzT1Bs1NvA7waBAG4CpyZMY3M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774582977; c=relaxed/simple; bh=gdokyZjz6V3LcMD0v1fsHLXET237Ewx2jfGOO/L0jPc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=BlKZ3ShkZywm6q+NXIo4zn5URHhCfHA9qoNDHazHbTZUMYtAm1iOxfbOoSQHub0ZGpF9PgnERceuvLwvlkFcQjzQZje8SVtH7k9TB/W1SCZb+LmmeMAgrKzrvGfzcCuK25rWOU/TjRxq525l/PZLQVLdkGgEpBa2RIMpe9WYDCc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=igalia.com; spf=pass smtp.mailfrom=igalia.com; dkim=pass (2048-bit key) header.d=igalia.com header.i=@igalia.com header.b=gR3/JHwO; arc=none smtp.client-ip=213.97.179.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=igalia.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=igalia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=igalia.com header.i=@igalia.com header.b="gR3/JHwO" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=qgQzHA5nzm2DhkXzeDRZwkRCQslE83+O28+Fq9ncgUw=; b=gR3/JHwO7po7fi4OW+rHr5a2ji ohYvUZKPd+aBkbiFpYqI6Kc/eaV5rcMAI05/GdOF88xCwKvSlkbpJ57qx64DPHbE41wtWx3oDzk0I MuhKmjjBS8sYctcDJy4UW3x8c0vr2MNge9Dvvz7oaOUW9yBriYqrq16lax8PSRr1+zE0xO/WewZBp VBCymhPL9NdHphqDvwiECqAWh8YXc5JxN4j1YFDftRqGQ8iMQJ432winS/gvl65DKKocsMNZuDWfT nYeh75n8dFuvmAHik24RShfkkqImeelnQmXmNcAGLNSAFYkHIz+fjo5KxBylbZOoHTSNewCfklMks L65EYqoQ==; Received: from [179.118.189.200] (helo=[192.168.15.100]) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_128_GCM:128) (Exim) id 1w5y5r-006z28-PL; Fri, 27 Mar 2026 04:42:43 +0100 Message-ID: Date: Fri, 27 Mar 2026 00:42:35 -0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta Subject: Re: [patch v2 00/11] futex: Address the robust futex unlock race for real To: Rich Felker Cc: LKML , Mathieu Desnoyers , Sebastian Andrzej Siewior , Carlos O'Donell , Peter Zijlstra , Florian Weimer , Torvald Riegel , Darren Hart , Thomas Gleixner , Ingo Molnar , Davidlohr Bueso , Arnd Bergmann , "Liam R . Howlett" , Uros Bizjak , =?UTF-8?Q?Thomas_Wei=C3=9Fschuh?= References: <20260319225224.853416463@kernel.org> <87bjgackw7.ffs@tglx> <20260326220815.GE18807@brightrain.aerifal.cx> Content-Language: en-US From: =?UTF-8?Q?Andr=C3=A9_Almeida?= In-Reply-To: <20260326220815.GE18807@brightrain.aerifal.cx> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Em 26/03/2026 19:08, Rich Felker escreveu: > On Thu, Mar 26, 2026 at 10:59:20PM +0100, Thomas Gleixner wrote: >> On Fri, Mar 20 2026 at 00:24, Thomas Gleixner wrote: >>> If the functionality itself is agreed on we only need to agree on the names >>> and signatures of the functions exposed through the VDSO before we set them >>> in stone. That will hopefully not take another 15 years :) >> >> Have the libc folks any further opinion on the syscall and the vDSO part >> before I prepare v3? > > This whole conversation has been way too much for me to keep up with, > so I'm not sure where it's at right now. > > From musl's perspective, the way we make robust mutex unlocking safe > right now is by inhibiting munmap/mremap/MAP_FIXED and > pthread_mutex_destroy while there are any in-flight robust unlocks. It > will be nice to be able to conditionally stop doing that if vdso is > available, but I can't see using a fallback that requires a syscall, > as that would just be a lot more expensive than what we're doing right > now and still not work on older kernels. So I think the only part > we're interested in is the fully-userspace approach in vdso. > You just need the syscall for the contented case (where you would need a syscall anyway for a FUTEX_WAKE). As Thomas wrote in patch 09/11: The resulting code sequence for user space is: if (__vdso_futex_robust_list$SZ_try_unlock(lock, tid, &pending_op) != tid) err = sys_futex($OP | FUTEX_ROBUST_UNLOCK,....); Both the VDSO unlock and the kernel side unlock ensure that the pending_op pointer is always cleared when the lock becomes unlocked. So you call the vDSO first. If it fails, it means that the lock is contented and you need to call futex(). It will wake a waiter, release the lock and clean list_op_pending. > If it sounds like I have a misconception of the current state of this > proposal from what I said above, let me know and I'll try to figure > out what I'm missing and catch up. > > Rich