Re: [linux-usb-devel] Re: Linux 2.6.16-rc3
From: Alan Stern
Date: Wed Feb 15 2006 - 17:22:36 EST
On Wed, 15 Feb 2006, James Bottomley wrote:
> On Wed, 2006-02-15 at 11:07 -0500, Alan Stern wrote:
> > Could we perhaps make this safer and more general?
> > For instance, add to struct device a "pending puts" counter and a list
> > header (both protected by a global spinlock), and have a kernel thread
> > periodically check the list, doing put_device wherever needed. How does
> > that sound?
> That's what I've been discussing with Jens elsewhere on this list.
> However, I think what you're proposing is overly complex. All we really
> need is for a way of flagging a kobject (or kref) so the final put will
> be in user context. Then we can use storage within the kobject or
> device (or something else) for the purpose.
That's more or less what I was suggesting. The problems are: How do you
know which put is the last? (Answer: you don't. So every put has to be
done in process context.) And how do you flag the data structure and tell
some process thread to do the put? (Answer: by putting the object on a
list, as in my suggestion.)
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/