PCI hotplug + EEH issues
Benjamin Herrenschmidt
benh at kernel.crashing.org
Thu Sep 12 17:31:46 EST 2002
>Another possibility is to use reference counting on the nodes (still
>using a lock to traverse from one node to the next and bump the count),
>but at least the caller will not need to hold a lock while *using* a
>node. I'm not sure I like the complexity of this idea considering the
>details of deleting a node while a traversal is in process somewhere
>else.
>
>Thoughts?
I prefer that reference counting solution. We have one lock protecting
the tree itself from insertion/removal and taken inside the traversal
functions. Any function returning a device_node will return it with
the reference counter incremented (the actual increment beeing done
with the lock held of course). Callers are expected to call some
kind of of_put_node() function that would then do the de-ref counting
and eventual deletion of the node data structure (pool allocation ?)
(I prefer of_release_node terminology but it seems we have a bunch of
get/put fanatics in the linux playfield ;)
Ben.
** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/
More information about the Linuxppc64-dev
mailing list