Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1975294imm; Thu, 12 Jul 2018 10:54:20 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf7PWoVfMjfu2gRVfjuNi4LlRZC4+U5TeFwS+anXJXHsBvAeIm+LuA0jHTaEb2PcEB6IrlM X-Received: by 2002:aa7:824d:: with SMTP id e13-v6mr3433890pfn.97.1531418060181; Thu, 12 Jul 2018 10:54:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531418060; cv=none; d=google.com; s=arc-20160816; b=Xe3sOK4MoiOD1D4rEqhQBEG/h1eTM9aT3dwjT2d5eTkBYgjzgnnNB2uLvMixYrX7kZ m/W/du/yYt2cM8clTJ47jzjxtODwZnKlsH+vv4feqQbnJIp6MR8/wgy1KiwTHhAk9Bye zagxzjDeFKKD2amBQHAqiewIVl4MAQ5XN81XnwtBiLyfzrSDu86iCR5eiQWK+CD6X9b2 5jAR97swsj+yFY23a4FXjf0/7mL57Rie2pr65rkp8R/G5BAEt2n+d3q+MXXbyK6xidEg 0pcaz6cK9t4DzNt+7DL7W4LcJInsZCRm5dDwzlar5P5SFiDZqd/iv23/pstkNOADlg/D oekQ== 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=szhr23pVXJblGUH93JYkIdBsdDtF5QaxckiOSOlZbbY=; b=gyE9hJayuqINluiDjGZ3gJcaxOBpItUQg58OmlF8D8ZLJiGVGa1seOE8sh1ivfkY64 iGXEe4RkfSfYRgsPThpQYRCBZ746rvKhz5aKEMLsPuaNUzhxhgDJapPY12/r7OYBvoju /1l6EV30CU7UhK0AJJyU5jLLOR1rq7c1wiJ+ohZjP0Zd7JnESOmJjdlIutw/EBN1IXiJ bMjuNVoUwcdRG6QL2d4LxnBN2hsQueQ9OJIaCulqMUg3VSY3b7V51nhictxbqfZXEcv9 UWi+oRNJPpn2J6itA/MWSwHVKiyY9wP77UrxZPC7wnEDT7dFmGPecAn0PO0uXsABv445 2HaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=TTdwuBEz; 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 i10-v6si24906494pfe.119.2018.07.12.10.54.04; Thu, 12 Jul 2018 10:54:20 -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=pass header.i=@amarulasolutions.com header.s=google header.b=TTdwuBEz; 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 S1726765AbeGLSDJ (ORCPT + 99 others); Thu, 12 Jul 2018 14:03:09 -0400 Received: from mail-wr1-f49.google.com ([209.85.221.49]:32772 "EHLO mail-wr1-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726349AbeGLSDI (ORCPT ); Thu, 12 Jul 2018 14:03:08 -0400 Received: by mail-wr1-f49.google.com with SMTP id g6-v6so13656910wrp.0 for ; Thu, 12 Jul 2018 10:52:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=szhr23pVXJblGUH93JYkIdBsdDtF5QaxckiOSOlZbbY=; b=TTdwuBEzdseNgDcGUQYsxsRJO2Rr0h4fLEjqOhAGvN8aXUxmtXYlFoVdugrOsVd1WK clmIR3lZB6fbtORsjaZ+145BfivsQjOReT7B8vl/VK9dj3n3vfzp28Eqam7wUGOSix5b CmSkNZWj3i3Ais2odBfa65VM43K6WZHnJMHh0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=szhr23pVXJblGUH93JYkIdBsdDtF5QaxckiOSOlZbbY=; b=JyYT72Gmh67436gsHHTpFbh3mcTK4n+R7hkBciPDjaJFmnhwhRYk27x2rc8hsydjE0 UgEGtTnCBiLZrh10lq2HOVZUjpoYOAL5YbVBMe/6vqY9zFhqTOoxSd9Dv4VI4f19Y/1W a8aZv6q85fH475cC/CpKnwkrj5c+GqxN1S4uSsEFcYYuXdIa+a0Y7XbBHUeO8LduQ/Kl NbbgWA2mmPsZnA5JCtYx8I7YqDcpd4tFwDAnD4Ukrvg4alOQBwYjlKUMHtJo66LuW5tK LwWoIyRBExqycA6CmlMQnmpnsh3sn0EfzIMBCD/vX5gIieDA7W/b/7Go+Er723LYNBgP 1faw== X-Gm-Message-State: AOUpUlE+gXtUGCnlI6D843LkdSP4dSyeBGi+DoIvryFnqa5Zh08JU0Jv PnyChZ2id0TMlTdEA2OzcUrFtg== X-Received: by 2002:adf:ed41:: with SMTP id u1-v6mr2385285wro.262.1531417951169; Thu, 12 Jul 2018 10:52:31 -0700 (PDT) Received: from andrea ([94.230.152.15]) by smtp.gmail.com with ESMTPSA id 65-v6sm7457850wmk.46.2018.07.12.10.52.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Jul 2018 10:52:30 -0700 (PDT) Date: Thu, 12 Jul 2018 19:52:28 +0200 From: Andrea Parri To: Alan Stern Cc: Peter Zijlstra , Will Deacon , "Paul E. McKenney" , LKMM Maintainers -- Akira Yokosawa , Boqun Feng , Daniel Lustig , David Howells , Jade Alglave , Luc Maranget , Nicholas Piggin , Kernel development list , Linus Torvalds Subject: Re: [PATCH v2] tools/memory-model: Add extra ordering for locks and remove it for ordinary release/acquire Message-ID: <20180712175228.GB3533@andrea> References: <20180712134821.GT2494@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.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > It seems reasonable to ask people to learn that locks have stronger > ordering guarantees than RMW atomics do. Maybe not the greatest > situation in the world, but one I think we could live with. Yeah, this was one of my main objections. > > Hence my proposal to strenghten rmw-acquire, because that is the basic > > primitive used to implement lock. > > That was essentially what the v2 patch did. (And my reasoning was > basically the same as what you have just outlined. There was one > additional element: smp_store_release() is already strong enough for > TSO; the acquire is what needs to be stronger in the memory model.) Mmh? see my comments to v2 (and your reply, in part., the part "At least, it's not a valid general-purpose implementation".). > > Another, and I like this proposal least, is to introduce a new barrier > > to make this all work. > > This apparently boils down to two questions: > > Should spin_lock/spin_unlock be RCsc? > > Should rmw-acquire be strong enough so that smp_store_release + > rmw-acquire is RCtso? > > If both answers are No, we end up with the v3 patch. If the first > answer is No and the second is Yes, we end up with the v2 patch. The > problem is that different people seem to want differing answers. Again, maybe you're confonding v2 with v1? Andrea > > (The implicit third question, "Should spin_lock/spin_unlock be RCtso?", > seems to be pretty well settled at this point -- by Peter's and Will's > vociferousness if nothing else -- despite Andrea's reservations. > However I admit it would be nice to have one or two examples showing > that the kernel really needs this.) > > Alan >