Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1432609imm; Thu, 12 Jul 2018 01:36:47 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeaF1CffYV+triEI6oH81ojI3pE1c8rqOYyQPsWp/lWfFK+pAQoQe9y8Aw8KyO5glQFSeh5 X-Received: by 2002:a17:902:8a95:: with SMTP id p21-v6mr1268992plo.91.1531384607573; Thu, 12 Jul 2018 01:36:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531384607; cv=none; d=google.com; s=arc-20160816; b=0Vb3bID7ASat+IlwT8IbmVSWz5WIo5ycbbVbaVtzHW0/HOnUfKvt3LZ+4bMCukmZIl jsAKh7p2pHVBt4nw83hu1p9dv4inCJnvHN6TD4exUAoY66XjOgK7d/aiitkwNyBrYEVd b8X781JMuecWXb8dl6DLl3QzO5ixjrtrdbiapIZiS94jjzhsR739AgH1PQ6r74sOlxba PL3TuMI38F3uBWUXUxz+7nM9/MIaPT697ACT2iIDy8FoLQggompY13yS0QIyYYjtpzI8 jkIfePjYVVwwHy1Rf39oXwS+vIVOCT6QnELgdaKEd7NcrDCKR7BlRx1JrM4HmKf67KB2 /4fw== 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=iXap7DYeYpsbQyalEh7351XYbxlkaaUGjBzPbw2c+gc=; b=tjgW9xKmPBm2itUZ+ufZdj9QAWAoaiD4QGX+tlSTptLNNmhWzkLyENTWtCiC6lUHKB 7aZONnJr18PmO4+BiDDSyb47Y3UNq7Bg6JvjMjy4Tt/Uc5MNgOhWC5njtAMTvjwjhhAx bV0qVaoY+WBPtMVICeIt8UbNGcYJPZ12Q8QDFAgBBdWy+wLxynOiJ25I3U9q32rARPBv nygkIoPMK7U3Rj0Y8VzUrxFF4mLRv4wMkt57Bk3jZ45yFsetz4zF/1Fjmy5DK/FxwbEO xuwwQuL2JnquV+7sSZCjF48RdRL9+ZR1Ajlw0Q0tXT2yuR/ImDU1QDVYUz61EZIyqAFD QLVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=IpfUcaWc; 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 a74-v6si9316904pfe.301.2018.07.12.01.36.31; Thu, 12 Jul 2018 01:36:47 -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=IpfUcaWc; 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 S1732297AbeGLIn0 (ORCPT + 99 others); Thu, 12 Jul 2018 04:43:26 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:37408 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726366AbeGLInZ (ORCPT ); Thu, 12 Jul 2018 04:43:25 -0400 Received: by mail-wm0-f66.google.com with SMTP id n17-v6so5114829wmh.2 for ; Thu, 12 Jul 2018 01:34:51 -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=iXap7DYeYpsbQyalEh7351XYbxlkaaUGjBzPbw2c+gc=; b=IpfUcaWcRzF2WDLwf7B/Jap880GjtDde7qWxgv9Rqr+f4O1z2uuFvKBTdTpC0nUAjc CskqinHPjOtZ9UYDNAfOeUTsP+tfBVM+BQqzVeSDZ1nBoIuL6jL2aniOnZMv/8e8CNwv WCwwkuL0MiNw2bV3apH+sQ3GsrBPI2OzqKsA4= 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=iXap7DYeYpsbQyalEh7351XYbxlkaaUGjBzPbw2c+gc=; b=gd92ufeah8lNpCIvfPwNMSNiVDgGJXjeDyrTGNmVB/ileC8fmvTY9wf75DgMyvPs9f GY5YcPXRNgnxZ03NFXtOUmRVVQWDZydM8S5fWwxQDlALtI5sqrNq9Ypy7DlfRDpc4fup zSZeL7IOcA2PvV7jsvVaDN5qUN2OxYhq154StJSCwaRbi8Tl4HzmJf5126FJUaYfCfd8 aKAEXDW42VCnomAsXQZqI1P+Tw1RFP1sz6MpmHo0n0hKY0DpVKjhvQWIHwa2c1xVvz4V hcW22DfS/wHvS+ZdHI/1luSkpfclrkJQL41qdrHJTwedlDWlZqUqIst1A639Nixfjoae PjBQ== X-Gm-Message-State: AOUpUlHfM4NDM8tRI8OL76C/0S0tdYrBgoepVgTAPvZuj4OYvCNqNNFO pzhI8algjHZB93TftwuOZeIqyQ== X-Received: by 2002:a1c:3c4:: with SMTP id 187-v6mr668234wmd.96.1531384490771; Thu, 12 Jul 2018 01:34:50 -0700 (PDT) Received: from andrea (85.100.broadband17.iol.cz. [109.80.100.85]) by smtp.gmail.com with ESMTPSA id a14-v6sm3027723wmb.44.2018.07.12.01.34.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Jul 2018 01:34:50 -0700 (PDT) Date: Thu, 12 Jul 2018 10:34:44 +0200 From: Andrea Parri To: Daniel Lustig Cc: Peter Zijlstra , Will Deacon , Alan Stern , "Paul E. McKenney" , LKMM Maintainers -- Akira Yokosawa , Boqun Feng , David Howells , Jade Alglave , Luc Maranget , Nicholas Piggin , Kernel development list Subject: Re: [PATCH v2] tools/memory-model: Add extra ordering for locks and remove it for ordinary release/acquire Message-ID: <20180712083444.GA4927@andrea> References: <20180710093821.GA5414@andrea> <20180711094310.GA13963@arm.com> <20180711123421.GA9673@andrea> <20180711155751.GC18477@arm.com> <20180711170053.GM2476@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 > All the discussion here[1] for example is about having ordering and > doing an smp_cond_load_acquire() on a variable which is sometimes > protected by a CPU's rq->lock and sometimes not? Isn't that one of the > key use cases for this whole discussion? Not a "pure" one: http://lkml.kernel.org/r/1530629639-27767-1-git-send-email-andrea.parri@amarulasolutions.com we also need "W->R ordering" in schedule()! so there better be an smp_mb__after_spinlock() or a barrier providing similar ordering. Nick was suggesting a "weaker version" of this barrier back in: 362a61ad61199e ("fix SMP data race in pagetable setup vs walking") c.f., the comment in mm/memory.c:__pte_alloc(), but that does not math our pattern (UNLOCK+LOCK), AFAICT. Andrea > > [1] https://lkml.org/lkml/2015/10/6/805 > > Dan