Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp503703imp; Thu, 21 Feb 2019 05:53:32 -0800 (PST) X-Google-Smtp-Source: AHgI3IZid3MlO/gwp5FlhjEcvftbeqWU3LDKPqozV4X8qEcSw11LYQdohhj3dtNF/ercG1LtDSwv X-Received: by 2002:a62:8d46:: with SMTP id z67mr39895797pfd.249.1550757212693; Thu, 21 Feb 2019 05:53:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550757212; cv=none; d=google.com; s=arc-20160816; b=E/dOix4L1o0BI6bM7pao8kegDFR+NLkDM/tfsfY8qaWbx1HghqGq6Mp4XMHCw7N9y9 5eIFuVMXghQIBC9AVesRiIm5DNIHbbJAXOVg8CFxrPrPfMIQdRU7oJ9VBcQrdaKhv+ac GCaKQZJ7Zf3Ktc1Hw/zy/2parIb7g6x1BYb6gtSI8ZPKY2MP92zjUptj6qbrEacSpP8u ap24tLESY/4O+Z8KKboFVHzCuTOkmz7IUlgA76VC1IhfroV4B3L0CmCM7wgvdWhT6XXD PiN/4rwsXaXD+lp+VPj0zzvEdfvlv5zEzS55oUd9x/5iZmsk+AoUR52FuSrbD9P84VSx u4pg== 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=/ia08tZg9ji11yrD0rSOToTCyY/Y/lkOMThFmxDvdL8=; b=gB+lKBL0mTaREAiosOA93Fw04OVOTncvIaT9TwD5aLJM5djOqP+N1SRie5XIdiDpBJ 6BiuMC9xc8ZWWvbvbuw9+y0BwnvBVBeI11u3fipNdB6kB4oOh0HkZBEXth5JAtLd9NlB /HBCBt1vHr91m+rcLpy/Bd9LJ4inK0CH+1f/nRDXPnEJ12AkNk3q7dtvqU60Ix+NPtC9 FWUol1+m2ffMtLl3BPtNV/Sk7JlqsdcLNToefkgtnLYNXTySn5YH9FVju5D7qIFz8m8i 4mj4gOnuarfL0vqDmgn+KguD4ybOpO1sstsnXkGGmtnpHMtJqjV4P6UKPeaCJ7q+cxKl m3dg== 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 e28si16092436pgm.368.2019.02.21.05.53.16; Thu, 21 Feb 2019 05:53:32 -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 S1728068AbfBUNvo (ORCPT + 99 others); Thu, 21 Feb 2019 08:51:44 -0500 Received: from mx2.suse.de ([195.135.220.15]:37304 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725385AbfBUNvn (ORCPT ); Thu, 21 Feb 2019 08:51:43 -0500 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 4F945AF81; Thu, 21 Feb 2019 13:51:42 +0000 (UTC) Date: Thu, 21 Feb 2019 14:51:40 +0100 From: Petr Mladek To: John Ogness 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 Message-ID: <20190221135140.enamunz6p54dt443@pathway.suse.cz> References: <20190212143003.48446-1-john.ogness@linutronix.de> <20190212143003.48446-5-john.ogness@linutronix.de> <20190214151650.5y337yy2jnnztsc6@pathway.suse.cz> <87ef8aosby.fsf@linutronix.de> <20190215134711.pimxhuwipkzlgq23@pathway.suse.cz> <87d0nr5heh.fsf@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87d0nr5heh.fsf@linutronix.de> User-Agent: NeoMutt/20170421 (1.8.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun 2019-02-17 02:32:22, John Ogness wrote: > Hi Petr, > > I've made changes to the patch that hopefully align with what you are > looking for. I would appreciate it if you could go over it and see if > the changes are in the right direction. And if so, you should decide > whether I should make these kinds of changes for the whole series and > submit a v2 before you continue with the review. > > The list of changes: > > - Added comments everywhere I think they could be useful. Is it too > much? Some comments probably can get shortened. But I personally find them really helpful. I am not going to do a detailed review of this variant at the moment. I would like to finish the review of the entire patchset first. > - I tried moving calc_next() into prb_reserve(), but it was pure > insanity. I played with refactoring for a while until I found > something that I think looks nice. I moved the implementation of > calc_next() along with its containing loop into a new function > find_res_ptrs(). This function does what calc_next() and push_tail() > did. With this solution, I think prb_reserve() looks pretty > clean. However, the optimization of communicating about the wrap is > gone. So even though find_res_ptrs() knew if a wrap occurred, > prb_reserve() figures it out again for itself. If we want the > optimization, I still think the best approach is the -1,0,1 return > value of find_res_ptrs(). I still have to go more deeply into it. Anyway, the new code looks much better than the previous one. Best Regards, Petr