Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp196635imj; Thu, 14 Feb 2019 18:27:47 -0800 (PST) X-Google-Smtp-Source: AHgI3IZbnOIVlXFQpPjWA7vD3ClTzUBSq1jcqBJO4nd7rLsaJisFef4MnkGb1nbzo3uH6ktKTqug X-Received: by 2002:a17:902:b01:: with SMTP id 1mr7688551plq.331.1550197667835; Thu, 14 Feb 2019 18:27:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550197667; cv=none; d=google.com; s=arc-20160816; b=NJE92+iEFnfKYb8EAc0jOyvCRiaeCXn9T6ZdzaZmoh33yTCQ8pTASuzBqeWgeZyrIZ IwNHoOY2vqNEeIlHHV6pLHB5X6YiOOcTEr2Irh1WFUwzvmXYLguTmXkFRIQkSfU8Kb9F U5Mjhf8WVs4GMQI1raCTYTmaVTkfJehKxcl6fvQk4lanq8UVzJMZjB0vgnsihDqgeKKz eRgwkjm9nJjpGOT2zpXQGvYzD3OGqp0gtrha0h72meMnlu/rttgbAATlwnxaQTSXjkiv 1lEVKLbeP3T+lwR5M40ubnVlrhjdAwIZyC6K73xPUonIztnsUyam7niAjk3mZ4W00MyE R+kw== 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=Gi2Oo68d2KFg/gtztKpDSmgTXlvMk8hi2IcOqJwtDpM=; b=aYvhJ+qJG+ANi/v6wuYnk6lNcaqftyFGg9gzFe4ZIU4zMiwxt1OH7YThy6yumgqLUl 7tWAdU4c+/iZOIJi4H7T9qwyOEJrINveYV0dV3RctL1tXgdhvP+hFBxK7iu03+Z47hFr xBF+GrU5O5cRZOUbxZE4J8YityLcPhsbyuvPN2kIk9iuyLc2AqdPLALKWCJfv09e7QMA 8HO9yE5Dde3JvvSNZXwsBWXqLgV+KbIO5zjWAjaabTutlo2aLbe5fACFFMHcSpydpSSY /2Ut5S/IeodFyRjgRlt5+U2vyRjwy+VoXuoz8SqH5pGIWS4r3/D9jj58SkuzyFRhraRe s3OQ== 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 u64si4180786pfi.239.2019.02.14.18.27.24; Thu, 14 Feb 2019 18:27:47 -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 S1730486AbfBOBUC (ORCPT + 99 others); Thu, 14 Feb 2019 20:20:02 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:51622 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726052AbfBOBUB (ORCPT ); Thu, 14 Feb 2019 20:20:01 -0500 Received: from localhost ([127.0.0.1] helo=vostro.local) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1guSAT-000617-Cv; Fri, 15 Feb 2019 02:19:53 +0100 From: John Ogness To: Petr Mladek Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Sergey Senozhatsky , Steven Rostedt , Daniel Wang , Andrew Morton , Linus Torvalds , Greg Kroah-Hartman , Alan Cox , Jiri Slaby , Peter Feiner , linux-serial@vger.kernel.org, Sergey Senozhatsky Subject: Re: [RFC PATCH v1 04/25] printk-rb: add writer interface References: <20190212143003.48446-1-john.ogness@linutronix.de> <20190212143003.48446-5-john.ogness@linutronix.de> <20190214151650.5y337yy2jnnztsc6@pathway.suse.cz> <87ef8aosby.fsf@linutronix.de> Date: Fri, 15 Feb 2019 02:19:50 +0100 In-Reply-To: <87ef8aosby.fsf@linutronix.de> (John Ogness's message of "Fri, 15 Feb 2019 00:36:49 +0100") Message-ID: <87a7ixq24p.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-02-15, John Ogness wrote: > prb_commit() does not actually care what is in the handle. It is going > to commit everything up to the reserve. After thinking about what I wrote here, I realized that the struct prb_handle has no purpose in this ringbuffer implementation. We really could simplify the writer interface to: char *prb_reserve(struct printk_ringbuffer *rb, unsigned int size); void prb_commit(struct printk_ringbuffer *rb); That probably feels really strange because the writer doesn't specify _what_ to commit. But this ringbuffer implementation doesn't need to know that. The only reason I can think of for having a handle is if there should be any statistics, debugging, or sanity checking added. (For example if a writer tried to commit something it did not reserve.) John Ogness