From: David Laight <david.laight.linux@gmail.com>
To: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
Cc: Jonathan Corbet <corbet@lwn.net>,
Randy Dunlap <rdunlap@infradead.org>,
kernel@collabora.com, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] docs: document linked lists
Date: Mon, 7 Jul 2025 10:11:56 +0100 [thread overview]
Message-ID: <20250707101156.2cc84294@pumpkin> (raw)
In-Reply-To: <20250702-linked-list-docs-v2-1-e36532f4b638@collabora.com>
On Wed, 02 Jul 2025 22:24:47 +0200
Nicolas Frattaroli <nicolas.frattaroli@collabora.com> wrote:
> The kernel contains various generic data structures that should ideally
> not be reinvented. However, it often fails to document the usage of
> these in the in-tree kernel documentation beyond just a listing of
> header symbols in the very lengthy kernel-api docs page. This is fine
> for things that have simple invocations, but occasionally things devolve
> into several layers of concatenating macros, which are subpar for humans
> to parse.
>
> Begin making a small impact by adding some rudimentary example-driven
> documentation for the linked list functions. Many aspects are covered,
> though it is not an exhaustive listing of the entire set of list
> operations. We also direct readers towards further documentation should
> they be interested in concurrency.
>
Jeepers; TLDR.
I don't think the kernel docs are a place to explain linked lists.
What may be relevant is a description of the types of linked list
the kernel uses.
For that you pretty much only need a picture of the head and two
items showing both the forward and backward pointers.
Then a list of the valid operations for that list type.
What you can (efficiently) do with a list depends very much on how
it is constructed.
Then repeat for hlist and hlist_nulls - I think they are the other
main list types.
IIRC 'LIST' is a double-linked list through a dummy item.
Not my favourite list type and can cause the sanitisers grief.
David
next prev parent reply other threads:[~2025-07-07 9:12 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-02 20:24 [PATCH v2] docs: document linked lists Nicolas Frattaroli
2025-07-03 1:37 ` Bagas Sanjaya
2025-07-03 2:52 ` Jonathan Corbet
2025-07-03 2:54 ` Bagas Sanjaya
2025-07-03 3:24 ` Bagas Sanjaya
2025-07-03 4:16 ` Randy Dunlap
2025-07-03 5:48 ` Bagas Sanjaya
2025-07-03 6:06 ` Randy Dunlap
2025-07-03 6:39 ` Bagas Sanjaya
2025-07-03 6:55 ` Randy Dunlap
2025-07-03 14:10 ` Jonathan Corbet
2025-07-04 20:53 ` Randy Dunlap
2025-07-07 9:11 ` David Laight [this message]
2025-07-07 12:30 ` Nicolas Frattaroli
2025-07-13 7:08 ` Randy Dunlap
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250707101156.2cc84294@pumpkin \
--to=david.laight.linux@gmail.com \
--cc=corbet@lwn.net \
--cc=kernel@collabora.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nicolas.frattaroli@collabora.com \
--cc=rdunlap@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox