Received: by 10.192.165.148 with SMTP id m20csp1936624imm; Sun, 6 May 2018 03:04:21 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrZBfbnbgeseBlbrm3l0AEOe5NHYGtrxY91LuaVyK6+eATftBenQnZLcIX8kYGvCK6yx1Dg X-Received: by 2002:a17:902:5a0d:: with SMTP id q13-v6mr33920095pli.199.1525601061355; Sun, 06 May 2018 03:04:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525601061; cv=none; d=google.com; s=arc-20160816; b=u/3ixWt/gJcQhi05CHuRXhZ/MFLUvzx4xw7d/kh747sKLS3s4hnuB3b2PJfEA/e3Jl grtGJiu1nnz1KqJczcXk7EBAwZGCs664rJ+F+hkoCZ4ICV5ss8vp+Okxuyx44P6/oGdy V4tjt9u0LLob3+ilnPxizJoCx5JAXCcGNdhomXrnWo7flWgtiPbqowzBaPvZIs4rrglX 0huR1U4Z9KAHK4ZufRnbKAEsG/iiTX59RA9Czv0afSogetc7OQi9pVAkAIMI1Hm3pnRV pCArPlr9kpLWZEdsnNSISIXheMDjWjm65UHZyMRzq0hLmGSk7PanYYUMRPgey8kneUde joXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=3rGVnPmYh/XCMWkXFeFSoLRuo6A+NoIFE23rmrKtBhw=; b=d4plj4WHJ+Yf0/vqw/B/dkuu83MxXw752toJdNtLHTUujlbgRKk4kzZDg/rfPZtM3m q8A7FpAxwJN3Hp+Wnb5NWIg75vwzMfl4qBzmQp4Eu5YSjUjYRO9BicwPWj88oxlmGWq+ z5iQ6UDNGR04XJtmVFz8W0FZ2G6USL/Jo81ZTPXKT0ksmzPzPzLoLswlUTq6Vyc55j4n Xz7vn0xuL0b2nFRBvCHQvzDbF2vBBcHHSipTWebBmKFN/lFDQ4Y5BGvu8FRzDUmArgqH HrhIzhjMkUCz6OVBZb8NQ577WpK9JHA1gODiHH6TUZArYJVZ12ykwm+TZYR7OeRvGlvi BFiA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n9-v6si13359019plk.584.2018.05.06.03.04.06; Sun, 06 May 2018 03:04:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751337AbeEFKD4 (ORCPT + 99 others); Sun, 6 May 2018 06:03:56 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:47411 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751187AbeEFKDy (ORCPT ); Sun, 6 May 2018 06:03:54 -0400 Received: from p57927711.dip0.t-ipconnect.de ([87.146.119.17] helo=nanos.glx-home) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fFGVw-0005eY-Tj; Sun, 06 May 2018 12:03:33 +0200 Date: Sun, 6 May 2018 12:03:32 +0200 (CEST) From: Thomas Gleixner To: Peter Zijlstra cc: Daniel Colascione , Mathieu Desnoyers , Paul McKenney , boqun.feng@gmail.com, luto@amacapital.net, davejwatson@fb.com, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Paul Turner , Andrew Morton , linux@arm.linux.org.uk, mingo@redhat.com, hpa@zytor.com, Andrew Hunter , andi@firstfloor.org, cl@linux.com, bmaurer@fb.com, rostedt@goodmis.org, josh@joshtriplett.org, torvalds@linux-foundation.org, catalin.marinas@arm.com, will.deacon@arm.com, Michael Kerrisk-manpages , Joel Fernandes Subject: Re: [RFC PATCH for 4.18 00/14] Restartable Sequences In-Reply-To: <20180502202233.GV12217@hirez.programming.kicks-ass.net> Message-ID: References: <20180430224433.17407-1-mathieu.desnoyers@efficios.com> <20180502172218.GL12180@hirez.programming.kicks-ass.net> <20180502202233.GV12217@hirez.programming.kicks-ass.net> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2 May 2018, Peter Zijlstra wrote: > On Wed, May 02, 2018 at 06:27:22PM +0000, Daniel Colascione wrote: > > On Wed, May 2, 2018 at 10:22 AM Peter Zijlstra wrote: > > >> On Wed, May 02, 2018 at 03:53:47AM +0000, Daniel Colascione wrote: > > > > Suppose we make a userspace mutex implemented with a lock word having > > three > > > > bits: acquired, sleep_mode, and wait_pending, with the rest of the word > > not > > > > being relevant at the moment. > > > > > So ideally we'd kill FUTEX_WAIT/FUTEX_WAKE for mutexes entirely, and go > > > with FUTEX_LOCK/FUTEX_UNLOCK that have the same semantics as the > > > existing FUTEX_LOCK_PI/FUTEX_UNLOCK_PI, namely, the word contains the > > > owner TID. > > > > That doesn't work if you want to use the rest of the word for something > > else, like a recursion count. With FUTEX_WAIT and FUTEX_WAKE, you can make > > a lock with two bits. > > Recursive locks are teh most horrible crap ever. And having the tid in > the word allows things like kernel based optimistic spins and possibly > PI related things. FWIW, robust futex have also the TID requirement. Thanks, tglx