[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190903075837.GA30322@jagdpanzerIV>
Date: Tue, 3 Sep 2019 16:58:37 +0900
From: Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
To: Petr Mladek <pmladek@...e.com>
Cc: John Ogness <john.ogness@...utronix.de>,
Andrea Parri <andrea.parri@...rulasolutions.com>,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
Steven Rostedt <rostedt@...dmis.org>,
Brendan Higgins <brendanhiggins@...gle.com>,
Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org
Subject: Re: numlist API Re: [RFC PATCH v4 1/9] printk-rb: add a new printk
ringbuffer implementation
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
Powered by blists - more mailing lists