* Whither klists?
@ 2005-09-01 18:09 Alan Stern
2005-09-01 18:16 ` Christoph Hellwig
0 siblings, 1 reply; 2+ messages in thread
From: Alan Stern @ 2005-09-01 18:09 UTC (permalink / raw)
To: Patrick Mochel, Greg KH; +Cc: Daniel Ritz, Kernel development list
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.
Alan Stern
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Whither klists?
2005-09-01 18:09 Whither klists? Alan Stern
@ 2005-09-01 18:16 ` Christoph Hellwig
0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2005-09-01 18:16 UTC (permalink / raw)
To: Alan Stern; +Cc: Patrick Mochel, Greg KH, Daniel Ritz, Kernel development list
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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-09-01 18:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-01 18:09 Whither klists? Alan Stern
2005-09-01 18:16 ` Christoph Hellwig
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®