public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Matthew Wilcox <matthew@wil.cx>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Remove completion from struct klist_node
Date: Fri, 3 Oct 2008 13:41:24 -0700	[thread overview]
Message-ID: <20081003204124.GA3269@kroah.com> (raw)
In-Reply-To: <20081003140618.GQ13822@parisc-linux.org>

On Fri, Oct 03, 2008 at 08:06:19AM -0600, Matthew Wilcox wrote:
> On Thu, Oct 02, 2008 at 03:17:45PM -0700, Greg KH wrote:
> > > +struct klist_waiter {
> > > +	struct klist_waiter *next;
> > > +	struct klist_node *node;
> > > +	struct task_struct *process;
> > > +	int woken;
> > > +};
> > 
> > Why not use the built-in list.h functions here?
> 
> I'm somewhat averse to using data structures when they do more than I
> need them to.

But part of the point is that if you use them, no one has to audit your
logic to make sure you got it all correct.

> list_heads are great for when you need to remove an entry
> from the middle of a list, but there are no advantages to using a
> doubly-linked list here -- we always walk it from the start to the end,
> and a singly linked list is fine for this purpose.  Maybe we need a set
> of 'slist' macros so we can use singly-linked-lists without thinking
> terribly hard, but I'd hate to see this patch get stuck behind
> infrastructure improvements.

Is size an issue here?  I don't think so and I'd prefer it to be changed
to use the standard list implementation and not roll your own.  You
never know who will cut-and-paste you code these days :)

Care to respin this?

thanks,

greg k-h

  reply	other threads:[~2008-10-03 23:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-02 21:43 [PATCH] Remove completion from struct klist_node Matthew Wilcox
2008-10-02 22:17 ` Greg KH
2008-10-03 14:06   ` Matthew Wilcox
2008-10-03 20:41     ` Greg KH [this message]
2008-10-16 20:57       ` Matthew Wilcox

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=20081003204124.GA3269@kroah.com \
    --to=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew@wil.cx \
    /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