agpgart.ko can't be unloaded
Hi,
I recently noticed that agpgart.ko (and corresponding hardware driver) can't be unloaded:
Module Size Used by intel_agp 19228 1 agpgart 27592 1 intel_agp
The same is true for via_agp and probably for all other drivers.
The problem is agpgart increases reference count of hw driver to prevent it from being unloaded, and the hw driver references agpgart so agpgart can't be unloaded either.
Should agpgart be split into 2 parts, one (which would have to be unloaded first) managing the thing and the other - the library referenced by hw drivers?
I wouldn't write about this but there is code to unload them so I think it's not intentional.
Signature · 1 line
Krzysztof Halasa
Quoted 6 lines
I recently noticed that agpgart.ko (and corresponding hardware driver) can't be unloaded:
Module Size Used by intel_agp 19228 1 agpgart 27592 1 intel_agp
BTW: "rmmod -w agpgart intel_agp" hangs in uninterruptible sleep state ("D") forever.
This is i386 (Athlon XP to be precise), FC4-current, 2.6.14.
Signature · 1 line
Krzysztof Halasa
Quoted 9 lines · Krzysztof Halasa
Quoted 6 lines
I recently noticed that agpgart.ko (and corresponding hardware driver) can't be unloaded:
Module Size Used by intel_agp 19228 1 agpgart 27592 1 intel_agpBTW: "rmmod -w agpgart
intel_agp" hangs in uninterruptible sleep state ("D") forever.
That can happen; "rmmod -w" will block until it's no longer used. Still used, still waiting.
Looks from these refcounts that intel_agp is being used. Who is holding the refcount?
Cheers,
Rusty.
Signature · 1 line
ccontrol: http://ozlabs.org/~rusty/ccontrol
Quoted 5 lines · Rusty Russell
That can happen; "rmmod -w" will block until it's no longer used. Still used, still waiting.
Looks from these refcounts that
intel_agpis being used. Who is holding the refcount?
That's another story - they have deadlocked wrt refcounts, that's why rmmod is waiting so hard.
I'd expect the rmmod to be interruptible, though. Thanks for info.
Signature · 1 line
Krzysztof Halasa
Quoted 11 lines · Krzysztof Halasa
Hi,
I recently noticed that agpgart.ko (and corresponding hardware driver) can't be unloaded:
Module Size Used by intel_agp 19228 1 agpgart 27592 1 intel_agpThe same is true for
via_agpand probably for all other drivers.
Quoted 7 lines
The problem is agpgart increases reference count of hw driver to prevent it from being unloaded, and the hw driver references agpgart so agpgart can't be unloaded either.
Should agpgart be split into 2 parts, one (which would have to be unloaded first) managing the thing and the other - the library referenced by hw drivers?
the reference on the chipset driver should only be bumped when /dev/agpgart is open()'d, but currently that isn't the case.
Quoted 2 lines
I wouldn't write about this but there is code to unload them so I think it's not intentional.
The reference counting has been horked since the 'new' module loader appeared[*], and never got fixed as I've nearly always found something more important to work on, and it's not really a problem for 99% of users. If someone found the time to write a patch to make it do the right thing though, I'd be happy to merge it as long as it's done correctly.
Dave
[*] In fact, my first attempt at fixing it way back then may have even made the problem worse.
Quoted 2 lines · Dave Jones
the reference on the chipset driver should only be bumped when
/dev/agpgartis open()'d, but currently that isn't the case.
Ok. I will look at it then.
Signature · 1 line
Krzysztof Halasa
Hi,
Quoted 8 lines
I recently noticed that agpgart.ko (and corresponding hardware driver) can't be unloaded:
Module Size Used by intel_agp 19228 1 agpgart 27592 1 intel_agpThe same is true for
via_agpand probably for all other drivers.
I am able to remove it with "rmmod -f" without problems and reinsert them again. It does not feel good, but at least they are out when one really wants to.
Jan Engelhardt