Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp908897ybl; Wed, 28 Aug 2019 07:05:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqzpsecMdu72A+sXyZKevqFtaAndg4j6cWJsUjyRm1MYkyBl48LCjCbUtGps7wQF5Nc9X4pt X-Received: by 2002:a17:90a:6581:: with SMTP id k1mr4413271pjj.47.1567001127959; Wed, 28 Aug 2019 07:05:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567001127; cv=none; d=google.com; s=arc-20160816; b=MW5frH6PMjE4bRvvOu0WbR97TkoAG9aElXiQ7J4ZbcOj0cKIWqdISqf2ZrgsPJAS2x Eu46jZ4nnatezK8UYDraQBvyVY9Mu0gKaQ1SpjOChaPKkDgOMcCZ0GCqj7hp6RBpfvIQ amt2WTkgjW6as8Yb8r4BjAi1dL5OW8Sw1ij1DRV7y0oVqsyIi4TljutmgC/AURKTXOon iG69DFEXNHbUjop3Eq0tE1FwaOjfDSaixxnBoam2Z03hR9mHs+E7KUe/H7VO2ImTkU/B mdGDbn0z6N9aBj17ZsMfs/H1J4v6elCPsVXKdIr7TP6W/LWMnDuY+oCSZV94W1ZwUOlS mcDw== 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=UtbA/LZ3dhBEoPxCD9JkGlm8mcweaN01PvC0ds+jbJU=; b=e/uLpLUJPYNZw8TVtKXKgaBi4t3/5CGoKcsa1zE7X7TPr9i16dxRqAhNptDkxQnXeK zyPQl6HKdUEkI6hfolk8KPjW3A1/rZO5BYRzggndMd5eCG3mZ0HGa3KcLUD9YsVzxRTv AXiI5SDEgFmYsxBJL8xFUG6WW8/6JDK0FHfVCar6P5N2WjKBUAtHPcdFnw43TRz288oi s2BnlSpYsubvBJhFeGgChwTRVQuPe9BI6/23CbZW744DU6gMzxvzjT30XxUwCWKbW6Pk 66DsCOBhr/ocgjeruUrm1PnSzwJkROoIhT3OzaRiCF8cV+dgRTPAAK0b7WAEEtXCv1Rl FPrQ== 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 143si2152328pgc.479.2019.08.28.07.05.08; Wed, 28 Aug 2019 07:05:27 -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; 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 S1727018AbfH1ODq (ORCPT + 99 others); Wed, 28 Aug 2019 10:03:46 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:47377 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726824AbfH1ODo (ORCPT ); Wed, 28 Aug 2019 10:03:44 -0400 Received: from localhost ([127.0.0.1] helo=vostro.local) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1i2yXz-0005Fc-Vf; Wed, 28 Aug 2019 16:03:40 +0200 From: John Ogness To: Petr Mladek Cc: Andrea Parri , 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 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> <20190827130349.6mrnhdlqyqokgsfk@pathway.suse.cz> <87o909lq3g.fsf@linutronix.de> <20190828085845.5k7ewfshbfed7txh@pathway.suse.cz> Date: Wed, 28 Aug 2019 16:03:38 +0200 In-Reply-To: <20190828085845.5k7ewfshbfed7txh@pathway.suse.cz> (Petr Mladek's message of "Wed, 28 Aug 2019 10:58:45 +0200") Message-ID: <87k1axjsjp.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-08-28, Petr Mladek 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 showed). 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 field. 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[0] asking about this.) John Ogness [0] https://lkml.kernel.org/r/20190820151239.yzdqz56yeldlknln@pathway.suse.cz