Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp1789989ybd; Thu, 27 Jun 2019 01:30:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqx/oXNRMBWOf/FQHxTxDBxQi90PWuxKM0m30ufRoxH4RY0G5GhhtcaDdKCDIyhfXv6v+Ioy X-Received: by 2002:a17:90a:20c6:: with SMTP id f64mr4559634pjg.57.1561624201683; Thu, 27 Jun 2019 01:30:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561624201; cv=none; d=google.com; s=arc-20160816; b=ol9UKR7f7q0z18vKUvCe0e2TguO4diZTIujzeEF6YyGDOToZKh1TNzhPsnzhlZhV+Z unfUIq72Q5LL/1gGVVbiwst+cR5nbTxYIeAYd0y4nDJPpnh7BRggkZ5vg7hLyLNmKe5Z bCbu/B1yaYz9dp35lVcoeG4p9d4r+7X3Y1U4LK64EpspvzFnnwV6Q7V8RSMbyMGjmKXr D6zToct81GwFtZrstQURA1gEhAuB8b/nrUEqg9O263BZvSM7PaYx2wRi5RyXooXNxbhS rnlYysF8G4Li+KGMRCixqB5ASO6WiMbU43KqcgAO7CpwKWa7Kth10Tt5QMe31ugdMVoX GKlA== 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; bh=iWGWkJuOvsSLftUatursT44hsK3Kla3AbdGzxAPvRkE=; b=HepeGtTzengbhuf9n1WQ/fCM8jyPDX7V8Zvz+6FFe8ORM7gauPYbDA5YQheBfuBHFL vCY1StuBOg81jLJzfc4xVWMbIMTIo0FGCEaR0MwfGqF9lI4HM1Z1oFsF7iT0u+z5Sl1T u2T00FfiCw7/ItvRwQ2p3YyeAhkBeG8WLNkwGyozEN5huoe+4bJoGHJG5KVzWBF48lHs NSXK4YAj15Dj4Yb/ozcGzVaATjAW3gvdWjEgWJFd5uh+MOrVnbiR4VcofwpTjtuhfXBs 0LSINhZ5g9s7/FEzBOqrDHXnDvNYYS8B3v/Rj3bqN0bb18neJNotRt04cqv37BrC0ZQE locQ== 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 m20si4602963pjn.9.2019.06.27.01.29.42; Thu, 27 Jun 2019 01:30:01 -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 S1726513AbfF0I2F (ORCPT + 99 others); Thu, 27 Jun 2019 04:28:05 -0400 Received: from mx2.suse.de ([195.135.220.15]:57860 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726059AbfF0I2F (ORCPT ); Thu, 27 Jun 2019 04:28:05 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 0A314AF51; Thu, 27 Jun 2019 08:28:04 +0000 (UTC) Date: Thu, 27 Jun 2019 10:28:03 +0200 From: Petr Mladek To: John Ogness Cc: Peter Zijlstra , 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 Message-ID: <20190627082803.7aduwbwxwejyhgan@pathway.suse.cz> 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> <87k1d8koo3.fsf@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87k1d8koo3.fsf@linutronix.de> User-Agent: NeoMutt/20170912 (1.9.0) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 2019-06-26 23:43:56, John Ogness wrote: > 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. Barriers are always paired. We need to know what variables are synchonized against each other, what is the reason and where is the counter part. I think that it might be done many ways. I am familiar with bariers in kernel/livepatch/ code. They use rather long description. But I find it pretty useful especially when the problem is complicated and more bariers are involved in a single transition. Best Regards, Petr