Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2064446imu; Thu, 10 Jan 2019 07:44:00 -0800 (PST) X-Google-Smtp-Source: ALg8bN5ZWG/0mhwugLTac5Uo5khofTeofwrljZd6bqGFgm7XhQDLvzYS3ntGE9hqxM3euP7Kq96v X-Received: by 2002:aa7:80d7:: with SMTP id a23mr10497023pfn.86.1547135040454; Thu, 10 Jan 2019 07:44:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547135040; cv=none; d=google.com; s=arc-20160816; b=C1e8TxTJ/CBDus/zhGYQ7upwTnyWRHE/dc/ZII4H2umZnbY0qubu+vqbcmgSN3wvT/ Syvp/uxS8ZDGLrYeMbMqEiLV5fUTqYEXqCIgDBgJF7x7g9xyGxeoPT4FjOzC+dp9QBnS LlgpSB65kpoUXtIctVW1FKC7vQ463Tv9T9RS2mPMBbMveBETz0pHVEtIukTXfaifNFtl WKiJ0WQ3dw75MG9BaR+G4X0boZF9aWPNNHHjKzJkknsdVPvlAPj5lNb760QnD86cG3bq iMiruzJRSAw+VC9fpH9r2v0a6gxk4KQPSE3Xv0cy9rsNpEpLr2G6sTj5xEJcXhuc4r1S 5WqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date; bh=2XgfxvScMtLixv66wacUEM7yxFZT5EQf2weKGSH36sw=; b=hlofVcW5/qnyuOVpx0aOf7MCnyBnbXbKmpxJbq2Q40SNHhh9+CzGoaDNFTDZrdyJ9M eF5m2Y0jCdkxuOagCnLaN2XO3b0XP2h/iK8FDqxDZcSAmca0kjg5qgkvohJfeaI/mzlP dPT+XLWUDqxLS/U8REuwGY2DiZXmPuM1669E/uYxgR+Vtrxhsp6ayIBnkxnx8ExeK/D7 lzcULxXL4Ncf4ZXMWymyrzjyDcNFMC4ZrqDIYEGvMpapc6fFlxM5myualx/1fjR+zt2y +ZoSc9fmiVpJNV2154Q2+2y1urBx3yvi5FCxd7t0sYO98SkGdk1y4jp6+bVqM87njR/E UySA== 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 m1si74857389pfi.286.2019.01.10.07.43.44; Thu, 10 Jan 2019 07:44:00 -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; 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 S1729600AbfAJPlZ (ORCPT + 99 others); Thu, 10 Jan 2019 10:41:25 -0500 Received: from iolanthe.rowland.org ([192.131.102.54]:35340 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1728998AbfAJPlY (ORCPT ); Thu, 10 Jan 2019 10:41:24 -0500 Received: (qmail 3497 invoked by uid 2102); 10 Jan 2019 10:41:23 -0500 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 10 Jan 2019 10:41:23 -0500 Date: Thu, 10 Jan 2019 10:41:23 -0500 (EST) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: "Paul E. McKenney" cc: Andrea Parri , , , , , , , , , , , , , Subject: Re: [PATCH RFC memory-model 0/6] LKMM updates In-Reply-To: <20190110143137.GJ1215@linux.ibm.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Alan