From: Christoph Hellwig <hch@infradead.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Patrick Mochel <mochel@digitalimplant.org>,
Greg KH <greg@kroah.com>, Daniel Ritz <daniel.ritz@gmx.ch>,
Kernel development list <linux-kernel@vger.kernel.org>
Subject: Re: Whither klists?
Date: Thu, 1 Sep 2005 19:16:45 +0100 [thread overview]
Message-ID: <20050901181645.GA7440@infradead.org> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0509011351400.5533-100000@iolanthe.rowland.org>
On Thu, Sep 01, 2005 at 02:09:19PM -0400, Alan Stern wrote:
> Patrick and Greg:
>
> To put it baldly: Should klists be replaced with regular lists, each
> protected by an rwsem (or even a mutex)?
>
> The advantage of klists is that threads can remove or add nodes while
> other threads iterate through the list. With an rwsem, only one thread
> would be able to add or remove a node at a time, and only when no other
> thread was using the list. Considering that klists are currently used
> to hold:
>
> the set of all devices on a bus,
>
> the set of all drivers for a bus, and
>
> the set of all children of a device,
>
> (not counting the set of all devices bound to a driver, since
> there's already a patch to replace that with a mutex-protected
> regular list)
>
> this limitation on adding or removing doesn't seem significant. There
> aren't many places where these lists are iterated over or altered. We
> could remove most of the overhead associated with klists and get rid of an
> extra API for people to learn.
>
> Note that this would be very different from the old bus subsystem rwsem.
> That protected too much -- everything associated with the bus subsystem --
> making it a pronounced chokepoint. My suggestion involves a separate
> rwsem for each of these lists, so that none of them would be subject to
> much contention.
Might also be worth to do a micro-benchmark for it (maybe in userland).
The current klist code is far too complex for it's own good.
prev parent reply other threads:[~2005-09-01 18:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-01 18:09 Alan Stern
2005-09-01 18:16 ` Christoph Hellwig [this message]
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=20050901181645.GA7440@infradead.org \
--to=hch@infradead.org \
--cc=daniel.ritz@gmx.ch \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mochel@digitalimplant.org \
--cc=stern@rowland.harvard.edu \
/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®