Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1636304ybe; Tue, 3 Sep 2019 01:01:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqxhxTg46TBZRuRk4yuY4TZc5/zrm3G2Bvmfl4+u7RX+YMhm9SGPa2pa2993i9h69PVqsJQi X-Received: by 2002:a65:5342:: with SMTP id w2mr28696234pgr.261.1567497698182; Tue, 03 Sep 2019 01:01:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567497698; cv=none; d=google.com; s=arc-20160816; b=CWj5aXYKvTX7DwYhwJtn8cZKNX1d995KiG0w2GLPs9JzmZcFY8WZOeFEQbV+T/P4MU sS89mr9fWM0OBJ7EXs47WBDiRRhLWLTF53M5HSMRBcx3W7y8sCsdNTUKv8iRUU/aLhI9 KlYApmy8J5npmcfV4O1Q0Nu84uh3Gbb2/67d3SQkyjhZjcsy9jA+TBgrrGmiFkmHVBr0 abGcl1puLdYV/pJ39/ooT2H9vnlL/AgV4v5eh7CbZyaOxf2/xEhduF6OB93wdzlMT07i dd1A/Dav6Ac1ZZNJRabYZgeIWXWoHeHT5pvEFFGhIhDHSW15/+fBcGHqN4teMDZtdc5a SkFw== 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=zfuRrUZi1m5bneOLAPdcpwGbeJ+nRXuErqjv4S4SGNc=; b=VQtHoS9QbNANHiX6dTM9O/LcG0fNq6QVf0s+dXd1MNJjWHe2Hc0u6tjsO9q6G+I0W0 mzf5d++g6ZeRYtyT8xuTO2Qm+ghri/yvnWdVZ70JBVNkS9lSUkSQsrmGvQ3xzXT2q/8W y71oetTOKA4yONxmKCDI9ewsY+jZsRXCMx1I7GhqKy3XaTlEnCaevbsjTADzCgmD03uD onA/i25nXJtjXeM7I5cL6v40fX6na9sYvPRytBi2n4/S5ATr8QPuA9aALNzBpRP83vKs bobrRikb/y/St3sFbq7fZAtI8XLDWDANs6TexwFx1psCLGUUCO9zJqoFyXFM44kRcZ75 iwQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iA7t8Ss2; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j75si14057324pgc.38.2019.09.03.01.01.21; Tue, 03 Sep 2019 01:01:38 -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=pass header.i=@gmail.com header.s=20161025 header.b=iA7t8Ss2; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727884AbfICH6m (ORCPT + 99 others); Tue, 3 Sep 2019 03:58:42 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:44732 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725878AbfICH6m (ORCPT ); Tue, 3 Sep 2019 03:58:42 -0400 Received: by mail-pf1-f195.google.com with SMTP id q21so5233196pfn.11 for ; Tue, 03 Sep 2019 00:58:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=zfuRrUZi1m5bneOLAPdcpwGbeJ+nRXuErqjv4S4SGNc=; b=iA7t8Ss201BF7nB3Sti/TkUxlKiWS2YBQTGzkbk/lCBEgWm4FCd9ocZteTqBFru779 zAb8Ui3QZ5yv/4RTaNrgEKbRgoJRIJQFQTsbKLgf+T7nWOs54lGqf6IbOEA0zn18dzv1 CwqioP4akrJe3yrG7Dg3SEAKmrwndlSnINHFnap0kvn4pip/SqvuZGtUlv99z07zBwYT Cc608/20NA7ExFK7IINlbAc7jmFNEEhtzVukoe2eJJNz4Sz1qMXCdmIArwZh5vzoe9no Dgtio93x2mpFrkjYtoG7wYaBnausTn+wfgaiDzukg9E5vWhUSFqRSOBPu+Xnib6VAn7Q iNFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=zfuRrUZi1m5bneOLAPdcpwGbeJ+nRXuErqjv4S4SGNc=; b=bItaM83642g970Jks5pF3pE05Lo9mDxrC2NNwjcpS1XnyMdcFZEIlVhgwNDGoVJIjX VW/HUpKhUE12sCsHIOVVSZAHq7Hl+5gM2qJcUND4ZBZEqXat8JuPW0K9pKVHTaUmfr5N vU6OHViYThD6+ZVnwzUgm9wLEatYUTMw0+oFYeGfo6GDDaX3P20vR02aJt2qj11bHHXz Q7FzTrdKPdwCm0BYXgjxg1wdjhCuLp2Tyam/t2qdnhs8gMVB+VKYLyPDHCblERuPjKX9 RZmRLD630EUDBeZKV/RNegIZGVfATNwlD7li/j4kYzIyxO+7z6ZuGZ1tn7d7wSv93zR6 2GjQ== X-Gm-Message-State: APjAAAUzc+w+Vt3CZ96/ZQrii2GDcn/Y1Xzx8Oew5a/opyQy+kDH2s2/ +X0viWmsk0eZxKb/k7vv7/w= X-Received: by 2002:a63:9245:: with SMTP id s5mr29603267pgn.123.1567497521586; Tue, 03 Sep 2019 00:58:41 -0700 (PDT) Received: from localhost ([175.223.38.155]) by smtp.gmail.com with ESMTPSA id c127sm3583405pfb.5.2019.09.03.00.58.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2019 00:58:40 -0700 (PDT) Date: Tue, 3 Sep 2019 16:58:37 +0900 From: Sergey Senozhatsky To: Petr Mladek Cc: John Ogness , Andrea Parri , Sergey Senozhatsky , Sergey Senozhatsky , Steven Rostedt , Brendan Higgins , Peter Zijlstra , Thomas Gleixner , Linus Torvalds , Greg Kroah-Hartman , linux-kernel@vger.kernel.org Subject: Re: numlist API Re: [RFC PATCH v4 1/9] printk-rb: add a new printk ringbuffer implementation Message-ID: <20190903075837.GA30322@jagdpanzerIV> References: <20190807222634.1723-1-john.ogness@linutronix.de> <20190807222634.1723-2-john.ogness@linutronix.de> <20190823171802.eo2chwyktibeub7a@pathway.suse.cz> <20190823171802.eo2chwyktibeub7a@pathway.suse.cz> <87sgpnmqdo.fsf@linutronix.de> <20190827130349.6mrnhdlqyqokgsfk@pathway.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190827130349.6mrnhdlqyqokgsfk@pathway.suse.cz> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (08/27/19 15:03), Petr Mladek wrote: [..] > > IMHO the API is sane. The only bizarre rule is that the numlist must > > always have at least 1 node. But since the readers are non-consuming, > > there is no real tragedy here. > > > > My goal is not to create some fabulous abstract data structure that > > everyone should use. But I did try to minimize numlist (and dataring) to > > only be concerned with clearly defined and minimal responsibilities > > without imposing unnecessary restrictions on the user. > > The API is complicated because of the callbacks. It depends on a logic > that is implemented externally. It makes it abstract to some extent. > > My view is that the API would be much cleaner and easier to review > when the ID handling is "hardcoded" (helper functions). It could be > made abstract anytime later when there is another user. Makes sense. > There should always be a reason why to make a code more complicated > than necessary. It seems that the only reason is some theoretical > future user and its theoretical requirements. Agreed. > Symmetry is really important. It is often sign of a good design. > > Simple and straightforward code is another important thing at > this stage. The code is complicated and we need to make sure > that it works. Any optimizations and generalization might > be done later when needed. Agreed. -ss