Re: numlist API Re: [RFC PATCH v4 1/9] printk-rb: add a new printk ringbuffer implementation
From: John Ogness
Date: Wed Aug 28 2019 - 10:03:47 EST
On 2019-08-28, Petr Mladek <pmladek@xxxxxxxx> wrote:
> I only think that, especially, numlist API is too generic in v4.
> It is not selfcontained. The consistency depends on external barriers.
> I believe that it might become fully self-contained and consistent
> if we reduce possibilities of the generic usage. In particular,
> the numlist should allow only linking of reusable structures
> stored in an array.
OK. I will make the numlist the master of the ID-to-node mapping. To
implement the getdesc() callback of the dataring, the printk_ringbuffer
can call a numlist mapping function. Also, numlist will need to provide
a function to bump the descriptor version (as your previous idea already
I plan to change the array to be numlist nodes. The ID would move into
the numlist node structure and a void-pointer private would be added so
that the numlist user can add private data (for printk_ringbuffer that
would just be a pointer to the dataring structure). When the
printk_ringbuffer gets a never-used numlist node, it can set the private
This has the added benefit of making it easy to detect accidental
never-used descriptor usage when reading dataring garbage. This was
non-trivial and I'm still not sure I solved it correctly. (I've already
spent a week working on a definitive answer to your email asking