From: Linus Torvalds <torvalds@linux-foundation.org>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: lkml - Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH RFC] struct list_node
Date: Sun, 10 Jun 2007 13:19:36 -0700 (PDT) [thread overview]
Message-ID: <alpine.LFD.0.98.0706101317090.14121@woody.linux-foundation.org> (raw)
In-Reply-To: <alpine.LFD.0.98.0706101013420.20321@woody.linux-foundation.org>
On Sun, 10 Jun 2007, Linus Torvalds wrote:
>
> The Linux kernel list.h is _better_ than most stupid list implementations
> that think that a head node is different from the list node. Exactly
> because it very naturally supports the notion of "this structure exists in
> a 'ring of entries'" where each node is 100% equivalent to any other node,
> and there _is_ no head.
Btw, to extend a bit on this: there actually *is* a "list with a head"
implementation in <linux/list.h>, called "hlist".
Now, the "h" actually historically stands for "hash", but if you prefer,
you can think of it as standing for "head", and be happy.
And if you want a head, you really do want to use "hlist", since the head
is smaller than a list entry (a single pointer rather than two).
And yes, I'm sure we could change some "struct list" users to "struct
hlist" if you wanted to.
Linus
next prev parent reply other threads:[~2007-06-10 20:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-10 5:11 Rusty Russell
2007-06-10 17:13 ` Randy Dunlap
2007-06-10 17:20 ` Linus Torvalds
2007-06-10 20:19 ` Linus Torvalds [this message]
2007-06-11 0:08 ` Rusty Russell
2007-06-11 0:02 ` Rusty Russell
2007-06-14 10:03 ` Jan Blunck
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=alpine.LFD.0.98.0706101317090.14121@woody.linux-foundation.org \
--to=torvalds@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
/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
all inboxes | Powered by JetHome®