Re: [RFC] fix sysfs symlinks

viro
2004-04-15T19:14:52Z

On Thu, Apr 15, 2004 at 05:13:32PM +0100, viro@parcelfarce.linux.theplanet.co.uk wrote:
> On Thu, Apr 15, 2004 at 09:10:11AM -0700, Greg KH wrote:
> > Yeah, I agree. For 2.7, I want to make static allocation of anything
> > that contains a kobject or kref not allowed to help fix things like
> > this.
> >
> > So once again we are back at the "module unload is hard" problem :)
>
> ITYM "for once we have a kind of objects that does disappear only on
> module unload, so yes, this time it's really module unload that is hard".

BTW, how about a new section that would
a) be allocated separately at module load time
b) contain a kobject with ->release() freeing that section
c) be populated with structures containing kobjects and having
no ->release(); main kobject would be pinned down by them. Original
refcount in each of those guys would be 1.

module_exit() would unregister all stuff we have in there and then drop
the references to them. No waiting for anything and when all references
to these objects are gone, we get the section freed. That can happen
way after the completion of rmmod - as the matter of fact we could have
the same module loaded again by that time.

AFAICS, that would solve the problem with static objects. Comments?