Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3878993ybl; Mon, 9 Dec 2019 01:28:06 -0800 (PST) X-Google-Smtp-Source: APXvYqyTWZa3ooaqIqke6meBO0y93niFHZxrGbE3/v0JJISKdLY6P8eZf+j7hofCyMF+FZhRvXel X-Received: by 2002:a9d:4f0f:: with SMTP id d15mr7621406otl.179.1575883686595; Mon, 09 Dec 2019 01:28:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575883686; cv=none; d=google.com; s=arc-20160816; b=iQ0LlN6JShTBWugInSDqtiI4vAXoYV2MX9FMyxmkoKh4tvKmqYWBLhIA1fuEXuLmXd Znut1KPuGvUgKbIXI+15sKoDdLBPwULh6B07zPlm74uzTfqfdg/ScXgV8/CeRElf+uAH wR6ON76d2heaQfAY1BZw9z7N/J1GBYykbR2wjI+YEQp+Dc1T78UBL2UyVXnqRiicNk4k NYFoFrQcxA/0Hyus1Vr3Z5/6cCU+ntrsZ6EboAJJuD1PyWbVtwtImGMIeR3pfRUY/rGk wcXQMQ3HXicVG+IHPU7MXmTctiRw058hFilH/UfJCXnh39yd8amlx4TFyAG20Gastr3C cgPg== 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=loLa2zXBX7Q+HG0g2eQhmhBgtoGZ7MRK9HyXSEh5tLw=; b=zqlqVBS43U1dzDr7Q/a61BP8KsTB8qzH9Ewp1LK7o5vr8Kv6jjaZK36QEXhOvx1mO9 MaSipBusIquTAQ0StYFZxNCiuLlI5P3uoxodpaI/BR7LoZHC7hOpoWWJ654FZGHpiqNV ebYQExZcjYMlod9Km0vk2lPAZb7ipfcZ9gcZgJdIV5l0FkROGWEY7w3l4vfAqSotrsEd vPbTLCZZB+8cDFgLI42+3lZtyewNLK5jqyQ8VpRb1Cf10yWePQYmcg4VaDjDiGV4LgFm GneXbzrpfpPYbGbdimg96XWWunX4SOMYL2TFZvCiALYLkAJgqr23tBrq51WpWAzg16wa O4rg== 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 t26si10803234oth.153.2019.12.09.01.27.54; Mon, 09 Dec 2019 01:28:06 -0800 (PST) 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 S1727411AbfLIJBR (ORCPT + 99 others); Mon, 9 Dec 2019 04:01:17 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:37938 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726377AbfLIJBR (ORCPT ); Mon, 9 Dec 2019 04:01:17 -0500 Received: from localhost ([127.0.0.1] helo=vostro.local) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1ieEuZ-0005Bv-75; Mon, 09 Dec 2019 10:00:59 +0100 From: John Ogness To: Sergey Senozhatsky Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Petr Mladek , Steven Rostedt , Linus Torvalds , Greg Kroah-Hartman , Andrea Parri , Thomas Gleixner , Sergey Senozhatsky , Brendan Higgins , kexec@lists.infradead.org Subject: Re: [RFC PATCH v5 1/3] printk-rb: new printk ringbuffer implementation (writer) References: <20191128015235.12940-1-john.ogness@linutronix.de> <20191128015235.12940-2-john.ogness@linutronix.de> <20191209074249.GC88619@google.com> Date: Mon, 09 Dec 2019 10:00:57 +0100 In-Reply-To: <20191209074249.GC88619@google.com> (Sergey Senozhatsky's message of "Mon, 9 Dec 2019 16:42:50 +0900") Message-ID: <87v9qpzxdi.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-12-09, Sergey Senozhatsky wrote: >> +#define _DATA_SIZE(sz_bits) (1UL << (sz_bits)) >> +#define _DESCS_COUNT(ct_bits) (1U << (ct_bits)) >> +#define DESC_SV_BITS (sizeof(int) * 8) >> +#define DESC_COMMITTED_MASK (1U << (DESC_SV_BITS - 1)) > > What does SV state for? State Value? Yes. Originally this thing was just called the state. But it was a bit confusing in the code because there is also an enum desc_state (used for state queries), which is _not_ the value that is stored in the state variable. That's why the code is using state_var/state_val (SV) for the actual data values, keeping it separate from desc_state/d_state for the the state queries. John Ogness