Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp31336imu; Thu, 10 Jan 2019 16:25:34 -0800 (PST) X-Google-Smtp-Source: ALg8bN461bJyvJ9HgesdQqQKcKF8QzY4G+eFvPdYfeJOapj0Xb0FRhOPOZF85MgkSwLeBPHSvfcB X-Received: by 2002:a62:4c5:: with SMTP id 188mr12542951pfe.130.1547166334029; Thu, 10 Jan 2019 16:25:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547166333; cv=none; d=google.com; s=arc-20160816; b=YfqIZVAhMPDuLc4eSMYZ8GFBn6fuHvVVDxmvblPEzX7HJEVMzhGU65gPYfI5UiTA6E lc2z3xXpOw1P9i3uUUOTf/CDUgKunt2yfTcP86ZGobKWSxezcKyoAorbloW/7KgKX2rf 1Cgmeqh8x8eDlZdQyYZxNmrscbDW7XoCgFBtYmQ+cyYpW8rixrDQ6KQ5Ggpzk/9lFJAc djz4n7AYUP+qbPuHbQc9/45CoCbJQMBf2qzWsMbbrKRmdjmxZBdoJYqj0GnZWfOFF8jB nlBdBxfXL4uGahRcfRnGDxM0BkA9ZJGJ3gOBcb3Rh7CRfagBlpjAxM0ilThKnjZVNLdK qUrw== 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; bh=doJgnFEbyNdmbkluOBGPL+4AnOydbSENU7NuuREeT0U=; b=jgJD6/4Ew2fotou/6TIM5COlhefkD+oAukV2YteOLxPxqIt27yQDeNvoKZ72sZgXtS Ax/zvdywpMWTYvqSLP2ycvIG3KhPIrg9EUbbwp/XyShRqH1vq/xLl+C0YhRTybPuVgLH RmdEgFaQ01m14tOHS21Q8kodJSTlDYTQikHagFqLlKXNGZK6vuk7xK/Eyv7cxpekiddU CK+IfZnos8DaSmSMTbFbPDJJvtIQUHXDn0NEwS16GSv+9ONxi3Y46SSxEBhzyvpDquRN y2HP85P+WsXnBFGmr9oTi3HxIxsj1mvApgOAmBhgi+Y7W7WRNEgR+9JMw64HZ8EkgT5P OuvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ldXLa73h; 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 b8si14380352pge.384.2019.01.10.16.25.18; Thu, 10 Jan 2019 16:25:33 -0800 (PST) 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=ldXLa73h; 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 S1729746AbfAJWqe (ORCPT + 99 others); Thu, 10 Jan 2019 17:46:34 -0500 Received: from mail-ed1-f65.google.com ([209.85.208.65]:42082 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729721AbfAJWqe (ORCPT ); Thu, 10 Jan 2019 17:46:34 -0500 Received: by mail-ed1-f65.google.com with SMTP id y20so11548441edw.9 for ; Thu, 10 Jan 2019 14:46:32 -0800 (PST) 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=doJgnFEbyNdmbkluOBGPL+4AnOydbSENU7NuuREeT0U=; b=ldXLa73ho8qlXN8jWGy6jxV9fLj0djJ5bTbhqNxyWGc+XsJk3J/idl3zvZ7BVcP9Cg z/XDMHcFMH9efGxmO04N7smpoent7syuJlaj0tTGsISzPRduE8yuHrt0rJ9s9aRINNvE 7lHw7YNKjQf8tS5AzPNbO5NpKLPRIOt8gSMq8= 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=doJgnFEbyNdmbkluOBGPL+4AnOydbSENU7NuuREeT0U=; b=h4o/5X93VGXMxG8lUIfWEu5DFqpRKH3QrPi8ixxFkPZP4ByYMlPbS7uxSvnknq69GV /Bx1cXdIwsNtXGsH4Z9ln1WmucDpJZlULm7gvEQjhhf1+bpzJlJMS8C4XewMju+1c7ih npZcLnP1X3rtDSINh2pXPT1y5emMof5k6T8e6T7ygk4dlkG22oaKC6gLlm6DjKwUythy fCl94WAPgsMFh9DXpADzuivLyZ6bIg/xqe12cNhqJQr6I6TgM+lB4iwgETB/FemrSXm2 Ff0JcIMmjItymnZQftPIiibr1bWDUr+tsBx4dPIdx7zNpCoVL8So+6y/SVho0kg8ODkK ItQw== X-Gm-Message-State: AJcUukdH1Eqs218UupZ9GqMOodxF4uvKjKXe2IzmEUWIf3CAYjq5+ECd 3sbQ0ijZT/usO3TM5wZOU9Vvmw== X-Received: by 2002:a17:906:b387:: with SMTP id o7-v6mr10200662ejz.124.1547160391191; Thu, 10 Jan 2019 14:46:31 -0800 (PST) Received: from andrea ([89.22.71.151]) by smtp.gmail.com with ESMTPSA id v12-v6sm1259204ejk.58.2019.01.10.14.46.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 10 Jan 2019 14:46:30 -0800 (PST) Date: Thu, 10 Jan 2019 23:46:22 +0100 From: Andrea Parri To: "Paul E. McKenney" Cc: Alan Stern , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, mingo@kernel.org, parri.andrea@gmail.com, will.deacon@arm.com, peterz@infradead.org, boqun.feng@gmail.com, npiggin@gmail.com, dhowells@redhat.com, j.alglave@ucl.ac.uk, luc.maranget@inria.fr, akiyks@gmail.com, willy@infradead.org Subject: Re: [PATCH RFC memory-model 0/6] LKMM updates Message-ID: <20190110224622.GA3701@andrea> References: <20190110143137.GJ1215@linux.ibm.com> <20190110163126.GS1215@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190110163126.GS1215@linux.ibm.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 10, 2019 at 08:31:26AM -0800, Paul E. McKenney wrote: > On Thu, Jan 10, 2019 at 10:41:23AM -0500, Alan Stern wrote: > > On Thu, 10 Jan 2019, Paul E. McKenney wrote: > > > > > On Thu, Jan 10, 2019 at 09:40:24AM +0100, Andrea Parri wrote: > > > > > > > > It seems that > > > > > > > > > > > > > > > > 1b52d0186177 ("tools/memory-model: Model smp_mb__after_unlock_lock()") > > > > > > > > > > > > > > > > from linux-rcu/dev got lost; this also needs an ack (probably yours! ;D, > > > > > > > > considered that, IIRC, you introduced the primitive and RCU is currently > > > > > > > > its only user.) > > > > > > > > > > > > > > That commit is in -tip: > > > > > > > > > > > > > > 4607abbcf464 ("tools/memory-model: Model smp_mb__after_unlock_lock()") > > > > > > > > > > > > > > So it has already left my -rcu tree. ;-) > > > > > > > > > > > > Oh, you're right: now I see the commit (e.g., with "git show"), but I > > > > > > don't see the corresponding changes applied to the tree. > > > > > > > > > > > > https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?h=locking/core&id=4607abbcf464ea2be14da444215d05c73025cf6e > > > > > > https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/tree/tools/memory-model/linux-kernel.bell?h=locking/core > > > > > > > > > > > > Is this expected? > > > > > > > > > > Are you asking why it is in -tip but not in mainline? I am not sure, > > > > > but given that the merge window was over the holiday season and that > > > > > the length of the merge window proved to be shorter than many people > > > > > expected it to be, I am not too surprised. ;-) > > > > > > > > Mmh, let me try again: > > > > > > > > $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git > > > > $ cd tip > > > > $ git checkout -b locking/core origin/locking/core > > > > > > > > $ git show 4607abbcf464 > > > > commit 4607abbcf464ea2be14da444215d05c73025cf6e > > > > Author: Andrea Parri > > > > Date: Mon Dec 3 15:04:49 2018 -0800 > > > > > > > > tools/memory-model: Model smp_mb__after_unlock_lock() > > > > > > > > $ cd tools/memory-model > > > > $ herd7 -conf linux-kernel.cfg after-unlock-lock-same-cpu.litmus > > > > File "after-unlock-lock-same-cpu.litmus": Unknown macro smp_mb__after_unlock_lock (User error) > > > > > > > > [aka, linux-kernel.def in tip:locking/core does not have the > > > > smp_mb__after_unlock_lock() added by 4607abbcf464] > > > > > > Color me confused: > > > > > > ------------------------------------------------------------------------ > > > > > > $ git checkout 4607abbcf464Checking out files: 100% (18397/18397), done. > > > Previous HEAD position was 4e284b1bf15a rcu: Remove wrapper definitions for obsolete RCU update functions > > > HEAD is now at 4607abbcf464 tools/memory-model: Model smp_mb__after_unlock_lock() > > > $ grep smp_mb__after_unlock_lock tools/memory-model/linux-kernel.def > > > smp_mb__after_unlock_lock() { __fence{after-unlock-lock}; } > > > > > > ------------------------------------------------------------------------ > > > > > > In addition, it handles this litmus test just fine: > > > > > > ------------------------------------------------------------------------ > > > > > > C MP+polocks > > > > > > (* > > > * Result: Never > > > * > > > * This litmus test demonstrates how lock acquisitions and releases can > > > * stand in for smp_load_acquire() and smp_store_release(), respectively. > > > * In other words, when holding a given lock (or indeed after releasing a > > > * given lock), a CPU is not only guaranteed to see the accesses that other > > > * CPUs made while previously holding that lock, it is also guaranteed > > > * to see all prior accesses by those other CPUs. > > > *) > > > > > > {} > > > > > > P0(int *x, int *y, spinlock_t *mylock) > > > { > > > WRITE_ONCE(*x, 1); > > > spin_lock(mylock); > > > smp_mb__after_unlock_lock(); > > > WRITE_ONCE(*y, 1); > > > spin_unlock(mylock); > > > } > > > > > > P1(int *x, int *y, spinlock_t *mylock) > > > { > > > int r0; > > > int r1; > > > > > > spin_lock(mylock); > > > r0 = READ_ONCE(*y); > > > spin_unlock(mylock); > > > r1 = READ_ONCE(*x); > > > } > > > > > > exists (1:r0=1 /\ 1:r1=0) > > > > > > ------------------------------------------------------------------------ > > > > > > Again, color me confused. > > > > Andrea's point is that while the 1b52d0186177 commit is present in the > > tip repository, it isn't in the locking/core branch. > > That commit is still in tip/master, so it has not been lost or > forgotten. ;-) Sounds reassuring! ;-) So, up to today, I've been using tip:locking/core as a reference for our "almost/tentative-upstream" LKMM changes; well, your reply suggests that I should have known better... thank you for the patience, Andrea > > Thanx, Paul >