Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3648511ybi; Tue, 18 Jun 2019 04:25:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqxhrwR+p/kKhGO/TDnVA8GjN/gVnssovgsiE128uGiAUYyUHS0c30vl5ZxtsZIxnTdjva8C X-Received: by 2002:a17:902:8489:: with SMTP id c9mr33312536plo.327.1560857107934; Tue, 18 Jun 2019 04:25:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560857107; cv=none; d=google.com; s=arc-20160816; b=s7B3BTXwr7i3+UEss7yMyYPn9YX9TQakVzvMlAfomwPDCq5pEEna7BOeIxPQDP1oRB 2t2F5rkDqW+oJACyiE4IZOfbuVno2JA2MrhYQ7DAALw17abherMDZAVi30zB0dbTD83O lf73y00UcC4u+CCp6c6oOWKjxXLificzktJ/jfpk8ZoioJfo5wXj9FDYPbdtIkKoy6FZ p+NELm3HhRL0yZw337oqQfeArHKJukKDOZ6h3IwqpRkfQrru7y/xMxYH2FvR51vsih8J bkt6Zmxb21t8exJ1/lS2f94mnFbWcqASuCrWDqRl4R+cyKyHruJjr3MQY0Li30h0OUmE DZIw== 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; bh=Zp5AooaLXIN2zMPxGFL82LcIQK5jh+gkBGpk8JLf+1Q=; b=vudqrrORx13hHeyHNJbsCxJm31h6h3SyEqftVBmIHJdDqKf1NyAh1MV9UQPgx7NMIn YupeKz110zQRMCw8jWRl7Foi+VTGqK2Z+7PDCiJ8Pb0Juv1LDZAwl5/T4tP0t/g3VXgC aKSFy/gFwtAEtE3djeBebXGFTjBb7Dvj6zdZt3ivpqUfTR72e4xZAsKtCQuddKRFzdEt qMbzYoLw53xBtfCbMWeLVrlZIFY6pY2JotdFG3RNcstXX9eNJVyjHDdBjABEsKb+beuF EZ2p4uAXXlcQwfjbOaiRPZ/Oe3f8+Kj5/v3D+bed2YGWLag1eMMLRuRK5yku0drcouYL RvsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Znq1UXh3; 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 s34si2075075pjc.2.2019.06.18.04.24.51; Tue, 18 Jun 2019 04:25: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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Znq1UXh3; 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 S1729675AbfFRLXH (ORCPT + 99 others); Tue, 18 Jun 2019 07:23:07 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:41778 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729110AbfFRLXH (ORCPT ); Tue, 18 Jun 2019 07:23:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Zp5AooaLXIN2zMPxGFL82LcIQK5jh+gkBGpk8JLf+1Q=; b=Znq1UXh362Oz3PQTLfHTJX6KJ NJd3/ib4+L1srDfuk06XsBY2B3g09LiLAcNOcDSkhukHqDG0e4gC5mSmVnDtQsSqcG5kADGFoXnks nge0t+S4n1cO6l0Gou22MdfwQ96GUYbs6Biu4UlLQalmQoMLkUCudOZ1k/oXVPGBmSAe6XcxpDuo/ ETxfN7dFyW54oxlPqueJFDWHpxJjAc5uNrtAb87lJ0DQ+p+5i2ZinOg08S4TGbJgDYCVJzDO7Bnrl gvpCROz3KjfWwpkyHPwgMjTulXWeyCMJgvX8ovL2fnAaoQHSU7w3inBg6+p7EXBfe/TWN2IsJE98x mUhzC94dw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hdCCF-0000UT-Ez; Tue, 18 Jun 2019 11:22:39 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id C81EE20A3C471; Tue, 18 Jun 2019 13:22:37 +0200 (CEST) Date: Tue, 18 Jun 2019 13:22:37 +0200 From: Peter Zijlstra To: John Ogness Cc: linux-kernel@vger.kernel.org, Petr Mladek , 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: <20190618112237.GP3436@hirez.programming.kicks-ass.net> References: <20190607162349.18199-1-john.ogness@linutronix.de> <20190607162349.18199-2-john.ogness@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190607162349.18199-2-john.ogness@linutronix.de> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 07, 2019 at 06:29:48PM +0206, John Ogness wrote: > +/** > + * DOC: memory barriers What's up with that 'DOC' crap? > + * > + * Writers > + * ------- > + * The main issue with writers is expiring/invalidating old data blocks in > + * order to create new data blocks. This is performed in 6 steps that must > + * be observed in order by all writers to allow cooperation. Here is a list > + * of the 6 steps and the named acquire/release memory barrier pairs that > + * are used to synchronized them: > + * > + * * old data invalidation (MB1): Pushing rb.data_list.oldest forward. > + * Necessary for identifying if data has been expired. > + * > + * * new data reservation (MB2): Pushing rb.data_list.newest forward. > + * Necessary for validating data. > + * > + * * assign the data block to a descriptor (MB3): Setting data block id to > + * descriptor id. Necessary for finding the descriptor associated with th > + * data block. > + * > + * * commit data (MB4): Setting data block data_next. (Now data block is > + * valid). Necessary for validating data. > + * > + * * make descriptor newest (MB5): Setting rb.descr_list.newest to descriptor. > + * (Now following new descriptors will be linked to this one.) Necessary for > + * ensuring the descriptor's next is set to EOL before adding to the list. > + * > + * * link descriprtor to previous newest (MB6): Setting the next of the > + * previous descriptor to this one. Necessary for correctly identifying if > + * a descriptor is the only descriptor on the list. > + * > + * Readers > + * ------- > + * Readers only make of smb_rmb() to ensure that certain critical load > + * operations are performed in an order that allows readers to evaluate if > + * the data they read is really valid. > + */ This isn't really helping much I feel. It doesn't begin to describe the ordering. But maybe the code makes more sense.