Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp1282172ybd; Wed, 26 Jun 2019 14:46:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqxMbYfLcJR/5KF5PGpz7A6YoprOIzNtj+vL21miaHM8mbGWrV9GZ9hQ0dpg7hFlQ/AKNmn8 X-Received: by 2002:a63:d103:: with SMTP id k3mr122471pgg.189.1561585577118; Wed, 26 Jun 2019 14:46:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561585577; cv=none; d=google.com; s=arc-20160816; b=QJDLqvV6gY6AUNbJQpWtp3bWp5TNjrB0vFzk44QAAvzWQTwZngmWIxzf9KUFjLLIxm 7h5HFRXt41aBJRUGPMW7ppwRmt6tLOsk5vXWcTJJgttAugfvRHcBv6uiUyZh3zb10qqD LH22/WJ9C9vohkgbKL3gZUA3OSMCjNiNdXzwv5qbCNNChckiBA9pA741eFFznwXh4tZw SScahfFJiK4KWe2ZE8+1oCXvzlsnleAMMyC58mxFaxfH+BYzJSBkssiUdbM94+xZn3Wp EOp6zyR6P9s40PAV6YxQxRM3guj7/yS+akoP1qINnHnblSufog6T2WDHpciAunZbQxSA 7/sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from; bh=j1j/47EOOPX2o5pnaLhS6mJiOgNrbHLMPsSAxABHCBg=; b=WC5QHozhdFnc9vQ0h6D/Q5+kN71HMvA9ifcbBzEFgCVA7LMcUCvhj393Cbr8q2JmnN OUncnQiEfxfbFhmqhWvkcdhjpfdDj18kgVbGSHLRuYIgbDeup6uuw9wOj85ab0CXGcie 1DFQsDQJZKFGcFGNFeHhZEbh+GrXx1bUm7DLBvmaxi/yrdp60u8LWUBlrdYHcLEu7YQk fwvrSZD18zMmokHviC9++q/ERIuR41eANUZKMDazbWmeccnBDLwVNleQFVBs45bE7ELy L+oWuv6rHD6RZ1C4EfXU/gGfEuze7OC2Djg9IjTo2jqfbWJJi+/efUWcNAZPuT/Z/sYf 9Waw== 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 64si302779plw.379.2019.06.26.14.46.00; Wed, 26 Jun 2019 14:46:17 -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; 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 S1726382AbfFZVoH (ORCPT + 99 others); Wed, 26 Jun 2019 17:44:07 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:50398 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726369AbfFZVoH (ORCPT ); Wed, 26 Jun 2019 17:44:07 -0400 Received: from localhost ([127.0.0.1] helo=vostro.local) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1hgFht-00084M-VS; Wed, 26 Jun 2019 23:43:58 +0200 From: John Ogness To: Peter Zijlstra Cc: Petr Mladek , linux-kernel@vger.kernel.org, Sergey Senozhatsky , Steven Rostedt , Linus Torvalds , Greg Kroah-Hartman , Andrea Parri , Thomas Gleixner , Sergey Senozhatsky Subject: Re: [RFC PATCH v2 1/2] printk-rb: add a new printk ringbuffer implementation References: <20190607162349.18199-1-john.ogness@linutronix.de> <20190607162349.18199-2-john.ogness@linutronix.de> <20190621140516.h36g4in26pe3rmly@pathway.suse.cz> <87d0j31iyc.fsf@linutronix.de> <20190626211610.GY7905@worktop.programming.kicks-ass.net> Date: Wed, 26 Jun 2019 23:43:56 +0200 In-Reply-To: <20190626211610.GY7905@worktop.programming.kicks-ass.net> (Peter Zijlstra's message of "Wed, 26 Jun 2019 23:16:10 +0200") Message-ID: <87k1d8koo3.fsf@linutronix.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) 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 2019-06-26, Peter Zijlstra wrote: >> Here are the writer-relevant memory barriers and their associated >> variables: >> >> MB1: data_list.oldest >> MB2: data_list.newest >> MB3: data_block.id >> MB4: descr.data_next >> MB5: descr_list.newest >> MB6: descr.next > > I think this is the fundamental divergence in parlance. > > You seem to associate a barrier with a (single) variable, where > normally a barrier is between two (or more) variables. The litmus tests I posted to answer your previous questions should (hopefully) show that I already understand this. The above list shows the _key_ loads/stores that are used to guarantee ordering (for these and other memory operations). And yes, I now understand that my comments need to list all the operations that are being ordered based on these key loads/stores. > As you wrote in that other email (I'm stlil going through all that); > your MB5 isn't desc_list.newest, but rather between desc_list.newest > and descr.next. Here is where I have massive problems communicating. I don't understand why you say the barrier is _between_ newest and next. I would say the barrier is _on_ newest to _synchronize_ with next (or something). I am struggling with terminology. (To be honest, I'd much rather just post litmus tests.) For example, if we have: WRITE_ONCE(&a, 1); WRITE_ONCE(&b, 1); WRITE_ONCE(&c, 1); smp_store_release(&d, 1); and: local_d = smp_load_acquire(&d); local_a = READ_ONCE(&a); local_b = READ_ONCE(&b); local_c = READ_ONCE(&c); How do you describe that? Do you say the memory barrier is between a and d? Or between a, b, c, d? (a, b, c aren't ordered, but they are one-way synchronized with d). I would say there is a barrier on d to synchronize a, b, c. John Ogness