Received: by 10.192.165.156 with SMTP id m28csp1834173imm; Thu, 12 Apr 2018 04:27:07 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/1ebWpy1gZltt9dUSMDf0skyaXyN8BEnrduEyZlZwwRKYcoog/PW4t+TXE/nfcoR+bgvjo X-Received: by 10.101.69.1 with SMTP id n1mr390706pgq.175.1523532427066; Thu, 12 Apr 2018 04:27:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523532427; cv=none; d=google.com; s=arc-20160816; b=xlv6L5s2ksQ+/Zsyt1NYpCzhulm0NPODlIPCdc9tFZqU4tNjTgGxfDnKp775SMhns3 VkvswF51d5urQkYDtglo41N7VuHZBVg8jBkfUSo49n96aYCdNKtWH7jq61sLielaBHMt 9blQehpoNbMUVVvoZjO3QFJGLNmJr8wZUeeOyxmuHceO03TRcn90SNwgKl/xRF28h708 Iwj5W0r8Cqb/ZKvDne+C7KIZtLoAIU1SZRquGR0vC32yyf7ZG6MPt6UhHShywS2BoIzp QtQXnF6a5Zrd5+RADJOAcu9eX6IQrZmZ/A3OQ0h1xz6l3owXPDay4Vuvzqfwo6rO2BIw LO6w== 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=T0PxWIIMbJU5QpIsu/VnMuZR7A3Jtylld6TvYsH/tuE=; b=EEPR6It1LZ561shzo9w4XCEgoV0CJYzXHwzueZ3Jk2+9KWcB8TVxJNqwOIG4M7hq/o t7KygU48s9lVlXEekPNDrayM1vcpMCjoLYehJN1rL8TpD83LvOiljp7yhQaxs9iO5/TF n3NmT241qb1WIcCFb01i8EYM2xFg90UAnx/42bGo4n4fwvDB0VKCkOnHrWfq1dinGAYt J/TAiMVSarzIRhPLhzdWVHiECRktmPbidI+sXjNibYheo1KRnjHTs/R1IgTUnIikETmd hNTp1epcC6yIp9Z0MwBM985LrhaA6C9BLvJHcm3qxFCFG6jVP8PdsUIFCHBR7QM2enpJ DNIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Jg9eQtt7; 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 l5si2537127pfa.368.2018.04.12.04.26.29; Thu, 12 Apr 2018 04:27:07 -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=Jg9eQtt7; 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 S1752810AbeDLLWG (ORCPT + 99 others); Thu, 12 Apr 2018 07:22:06 -0400 Received: from mail-wr0-f174.google.com ([209.85.128.174]:46233 "EHLO mail-wr0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751589AbeDLLWE (ORCPT ); Thu, 12 Apr 2018 07:22:04 -0400 Received: by mail-wr0-f174.google.com with SMTP id d1so4733409wrj.13 for ; Thu, 12 Apr 2018 04:22:04 -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=T0PxWIIMbJU5QpIsu/VnMuZR7A3Jtylld6TvYsH/tuE=; b=Jg9eQtt7Ep25fVb+BiCsiuMz/23YTJT7KqM0AzSiViip3QCPIvDHHDv5YcOvgiZdKF LjE0EO6TJqTvrKMVgCXayyhfifFIVQ8+wQGLcwwYEjCX3CbkqMdAxVoSGN1b91CAaKTS V9ltXHtRqLTK1lFHKzdkbDYiBCiGS1KUnQhAM= 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=T0PxWIIMbJU5QpIsu/VnMuZR7A3Jtylld6TvYsH/tuE=; b=Z1KoHwRXlpzI36CJqz56rDstepTACQ+CIk0zxU5Jth1zcUJWK5m6q41HedLkTH2JVH iWj1qGpG66NwageAeZMCtat06/Sa2FTg3OlytYcqDxtPqRSkXXPTgA0Vzo1PWYC3YDCY w6fQD8wTJF8w+XeZ9cCrKaJuGosuyT1a8JUlTRgXBOQQZMlASx02RVQ5nP32pTU2DaOC 2dD6IHwHXTkgtjQrfTPq1q3o9fwk4wp6a0Myr1JLPEwSi1sDFhEx/fVBaCvFECDj6l1M rqhT5R4s6wSWI7C5VRgTITwpchYm7YpSAU4BAkZ0Ev1Szj4VdE7WpDFjvro5yeuVrm87 O2iQ== X-Gm-Message-State: ALQs6tCvT9WY6nrBB51vqkR0RSTMiyIH/Bg2oIF1n+swhaRGFChKY7A0 DilqaeeGE8/cBVq9TWcWR0hrmA== X-Received: by 10.223.150.111 with SMTP id c44mr524204wra.90.1523532123310; Thu, 12 Apr 2018 04:22:03 -0700 (PDT) Received: from andrea ([213.209.242.222]) by smtp.gmail.com with ESMTPSA id m18sm3798994wri.65.2018.04.12.04.22.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Apr 2018 04:22:02 -0700 (PDT) Date: Thu, 12 Apr 2018 13:21:55 +0200 From: Andrea Parri To: Paolo Bonzini Cc: paulmck@linux.vnet.ibm.com, linux-kernel@vger.kernel.org, Alan Stern , Andrea Parri , Will Deacon , Peter Zijlstra , Boqun Feng , Nicholas Piggin , David Howells , Jade Alglave , Luc Maranget , Akira Yokosawa Subject: Re: [PATCH] memory-model: fix cheat sheet typo Message-ID: <20180412112155.GA9154@andrea> References: <1523292618-10207-1-git-send-email-pbonzini@redhat.com> <20180409184258.GP3948@linux.vnet.ibm.com> <20180410203214.GA19606@linux.vnet.ibm.com> <8cbda122-6aa3-365b-fd09-52dca0644cbd@redhat.com> <20180410213434.GC3948@linux.vnet.ibm.com> <156ac07b-7393-449f-518a-6b1c2cff8efb@redhat.com> <20180412092303.GA6044@andrea> 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 On Thu, Apr 12, 2018 at 12:18:13PM +0200, Paolo Bonzini wrote: > On 12/04/2018 11:23, Andrea Parri wrote: > >> > >> - smp_store_mb() is missing > > > > Good point. In fact, we could add this to the model as well: > > following Peter's remark/the generic implementation, > > Good idea. smp_store_mb() can save some clock cycles in the relatively > common idiom > > write a write b > read b read a > if (b) if (a) > wake 'em we've been woken > > > Yeah, those 'Ordering is cumulative', 'Ordering propagates' could > > mean different things to different readers... IMO, we may even omit > > such information; this doc. does not certainly aim for completeness, > > after all. OTOH, we ought to refrain from making this doc. an excuse > > to transform (what it is really) high-school maths into some black > > magic. > FWIW, what I miss in explanation.txt (and to some extent in the paper) > is a clear pointer to litmus tests that rely on cumulativity and > propagation. In the meanwhile I'll send some patches. Thanks for the > feedback, as it also helps validating my understanding of the model. The litmus test that first comes to my mind when I think of cumulativity (at least, 'cumulativity' as intended in LKMM) is: WRC+pooncerelease+rmbonceonce+Once.litmus for 'propagation', I could mention: IRIW+mbonceonces+OnceOnce.litmus (both tests are availabe in tools/memory-model/litmus-tests/). It would be a nice to mention these properties in the test descriptions, indeed. You might find it useful to also visualize the 'valid' executions (with the main events/relations) associated to each of these tests; for this, $ herd7 -conf linux-kernel.cfg litmus-tests/your-test.litmus \ -show all -gv (assuming you have 'gv' installed). Andrea > > Thanks, > > Paolo