Re: klists and struct device semaphores
From: Patrick Mochel (mochel_at_digitalimplant.org)
Date: 03/29/05
- Previous message: Horst von Brand: "Re: Can't use SYSFS for "Proprietry" driver modules !!!."
- In reply to: Alan Stern: "Re: klists and struct device semaphores"
- Next in thread: Patrick Mochel: "Re: klists and struct device semaphores"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 29 Mar 2005 08:38:11 -0800 (PST) To: Alan Stern <stern@rowland.harvard.edu>
On Mon, 28 Mar 2005, Alan Stern wrote:
> On Mon, 28 Mar 2005, Patrick Mochel wrote:
> > Do you have suggestions about an alternative (with code)?
>
> Here's something a little better than pseudocode but not as good as a
> patch... :-)
> To fill the first field in correctly requires that klist creation use a
> macro; the details are unimportant. What is important is that during
> klist_node_init you add:
In principle, you're right. Kind of. We need to tie the "usage" reference
count of the klist_node to the containing objects' "lifetime" count. But,
there is no need to confuscate the klist code to do it. At least not at
this point.
The subsystems that use the code must be sure to appropriately manage the
lifetime rules of the containing objects. That is true no matter what.
When they add a node, they should increment the reference count of the
containing object and decrement when the node is removed. If practice
shows that there is more that can be rolled into the model, then we can
revisit it later.
[ Sidebar: Perhaps we can add a callback parameter to klist_remove() to
call when the node has been removed, instead of the struct completion. ]
Pat
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- Previous message: Horst von Brand: "Re: Can't use SYSFS for "Proprietry" driver modules !!!."
- In reply to: Alan Stern: "Re: klists and struct device semaphores"
- Next in thread: Patrick Mochel: "Re: klists and struct device semaphores"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|