Received: by 10.192.165.148 with SMTP id m20csp1585964imm; Thu, 3 May 2018 01:50:53 -0700 (PDT) X-Google-Smtp-Source: AB8JxZox6f6cAytKzn4WKM+Ajeudsuwy1y9yatMdZLf4cfeDKYyKDlG1D5yBdwPOvv6/ZBC2ve9v X-Received: by 10.98.18.212 with SMTP id 81mr22433599pfs.243.1525337453512; Thu, 03 May 2018 01:50:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525337453; cv=none; d=google.com; s=arc-20160816; b=OE5MSmK3Fb1iBjcKCR3Tea5VA3W9gewvUUZDTxeqboyrEOc+Imj6R51xxpc03DTtZ0 J9DDmbrrwt5WRwqni2jEoMlHZdOoUtq9blTuxOaMsSt5oLpC1dhfPMwyw+AtcWlcr+9H /475UunXIoo2N7l2uUNNub2V31Oz/LnGxytH7GUTaq8GT6SzTq4pxx+sFBBPzTruLg7D 7/dbP+mbtXEplds2TbavFFbL9hioJIqegO1EhxD/JAmVwwOMntw55G5nvMuGmQxPvwIv nIgUluHhKU9/iGINum9fYYXFwrd9RNqyBAEPQNTFw4MMuO34K2Gxf7s19ShN/0u1ujt6 uEWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=soDF+QjWNJnZEKj/Ergt5xyaml2Ml0FnbBSfhqgRGhg=; b=oVsIYG2tLP7eAu4tWyFhLdDXDlWvR3aYAaN60Nnaa51E1ME0ML504/OWyRMUeMaZQo Uj3puPG3vjTq9uCG8lIAwh+K77Gw80OLDv/XSmjMycpssjpO8/fHWFYHh/aN5ph1p7Fx oNXBNjQZ300Bq5XWsWWlQXDwrm4aJOT+VSoUh9OY/MlKR3zSy4Xq+6Na8mEFu5Hc6oIC a4A85oVYsp6Yw0bYD6uolPJhbSt6K5Ythyt9X7m+Udyu506Nf5s63lE4eOiW+Jk0144m gIkCezCqBQLx0wXrUJBN2Ex/M9zGwEPv9U5DkgTcCPWID1WA90bB34vsO2KSdaOfnwRp jQ9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=oI6837qz; 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 j33-v6si3312139pld.151.2018.05.03.01.50.39; Thu, 03 May 2018 01:50:53 -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; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=oI6837qz; 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 S1751704AbeECIuH (ORCPT + 99 others); Thu, 3 May 2018 04:50:07 -0400 Received: from merlin.infradead.org ([205.233.59.134]:38300 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751629AbeECIt6 (ORCPT ); Thu, 3 May 2018 04:49:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding: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=soDF+QjWNJnZEKj/Ergt5xyaml2Ml0FnbBSfhqgRGhg=; b=oI6837qze57kSl8msnllUtOk9 hhETo3yEyS/3rCvCIg1JZI04ySyj++LrE4Bg2p7+6sBpY4KcLpIM50R9tSJecp0ZYtBQNsjQWAGY5 cXoNMGrhW8LMslYjzAg0qiCQi9jzHLgbxr+v2KnRUxQ2/yJUaStPXHvu60Y1XbmmzzZ+N3ivEzDmZ mLmbn1cuN+1ebtHH5cbZWeXFYb7NI4dD79/alA52GBuAwDbvsujPqLMOHNZx1I4mAvFTVEvsId0Ef i9BkGMAKiPW1eq0Psvv/ztg+6R1o9AKxAutr0qbJWmOlAi1bBcqCA0A6Rr7+gcXvpUql8HIUH0IgF d2YrBCSsg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fE9vJ-0000NQ-SP; Thu, 03 May 2018 08:49:10 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 736A8202ACE64; Thu, 3 May 2018 10:49:06 +0200 (CEST) Date: Thu, 3 May 2018 10:49:06 +0200 From: Peter Zijlstra To: Daniel Colascione Cc: 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, tglx@linutronix.de, 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 Message-ID: <20180503084906.GW12217@hirez.programming.kicks-ass.net> References: <20180430224433.17407-1-mathieu.desnoyers@efficios.com> <20180502172218.GL12180@hirez.programming.kicks-ass.net> <20180502202233.GV12217@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 02, 2018 at 08:37:13PM +0000, Daniel Colascione wrote: > > Recursive locks are teh most horrible crap ever. And having the tid in > > What happened to providing mechanism, not policy? > > You can't wish away recursive locking. It's baked into Java and the CLR, > and it's enshrined in POSIX. It's not going away, and there's no reason not > to support it efficiently. You can implement recursive locks just fine with a TID based word, just keep the recursion counter external to the futex word. If owner==self, increment etc.. > > the word allows things like kernel based optimistic spins and possibly > > PI related things. > > Sure. A lot of people don't want PI though, or at least they want to opt > into it. And we shouldn't require an entry into the kernel for what we can > in principle do efficiently in userspace. Any additional PI would certainly be opt-in, but the kernel based spinning might make sense unconditionally.