public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* agpgart.ko can't be unloaded
@ 2005-12-15 20:19 Krzysztof Halasa
  2005-12-15 20:38 ` Krzysztof Halasa
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Krzysztof Halasa @ 2005-12-15 20:19 UTC (permalink / raw)
  To: Dave Jones; +Cc: linux-kernel

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.
-- 
Krzysztof Halasa

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: agpgart.ko can't be unloaded
  2005-12-15 20:19 agpgart.ko can't be unloaded Krzysztof Halasa
@ 2005-12-15 20:38 ` Krzysztof Halasa
  2005-12-17  1:31   ` Rusty Russell
  2005-12-15 20:52 ` Dave Jones
  2005-12-16 22:28 ` Jan Engelhardt
  2 siblings, 1 reply; 7+ messages in thread
From: Krzysztof Halasa @ 2005-12-15 20:38 UTC (permalink / raw)
  To: Dave Jones, Rusty Russell; +Cc: linux-kernel

> 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.
-- 
Krzysztof Halasa

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: agpgart.ko can't be unloaded
  2005-12-15 20:19 agpgart.ko can't be unloaded Krzysztof Halasa
  2005-12-15 20:38 ` Krzysztof Halasa
@ 2005-12-15 20:52 ` Dave Jones
  2005-12-15 22:58   ` Krzysztof Halasa
  2005-12-16 22:28 ` Jan Engelhardt
  2 siblings, 1 reply; 7+ messages in thread
From: Dave Jones @ 2005-12-15 20:52 UTC (permalink / raw)
  To: Krzysztof Halasa; +Cc: Dave Jones, linux-kernel

On Thu, Dec 15, 2005 at 09:19:10PM +0100, Krzysztof Halasa wrote:
 > 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?

the reference on the chipset driver should only be bumped when
/dev/agpgart is open()'d, but currently that isn't the case.

 > 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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: agpgart.ko can't be unloaded
  2005-12-15 20:52 ` Dave Jones
@ 2005-12-15 22:58   ` Krzysztof Halasa
  0 siblings, 0 replies; 7+ messages in thread
From: Krzysztof Halasa @ 2005-12-15 22:58 UTC (permalink / raw)
  To: Dave Jones; +Cc: linux-kernel

Dave Jones <davej@redhat.com> writes:

> the reference on the chipset driver should only be bumped when
> /dev/agpgart is open()'d, but currently that isn't the case.

Ok. I will look at it then.
-- 
Krzysztof Halasa

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: agpgart.ko can't be unloaded
  2005-12-15 20:19 agpgart.ko can't be unloaded Krzysztof Halasa
  2005-12-15 20:38 ` Krzysztof Halasa
  2005-12-15 20:52 ` Dave Jones
@ 2005-12-16 22:28 ` Jan Engelhardt
  2 siblings, 0 replies; 7+ messages in thread
From: Jan Engelhardt @ 2005-12-16 22:28 UTC (permalink / raw)
  To: Krzysztof Halasa; +Cc: Dave Jones, linux-kernel

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.

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
-- 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: agpgart.ko can't be unloaded
  2005-12-15 20:38 ` Krzysztof Halasa
@ 2005-12-17  1:31   ` Rusty Russell
  2005-12-17 15:16     ` Krzysztof Halasa
  0 siblings, 1 reply; 7+ messages in thread
From: Rusty Russell @ 2005-12-17  1:31 UTC (permalink / raw)
  To: Krzysztof Halasa; +Cc: Dave Jones, linux-kernel

On Thu, 2005-12-15 at 21:38 +0100, Krzysztof Halasa wrote:
> > 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.

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.
-- 
 ccontrol: http://ozlabs.org/~rusty/ccontrol


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: agpgart.ko can't be unloaded
  2005-12-17  1:31   ` Rusty Russell
@ 2005-12-17 15:16     ` Krzysztof Halasa
  0 siblings, 0 replies; 7+ messages in thread
From: Krzysztof Halasa @ 2005-12-17 15:16 UTC (permalink / raw)
  To: Rusty Russell; +Cc: Dave Jones, linux-kernel

Rusty Russell <rusty@rustcorp.com.au> writes:

> 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?

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.
-- 
Krzysztof Halasa

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-12-17 15:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-15 20:19 agpgart.ko can't be unloaded Krzysztof Halasa
2005-12-15 20:38 ` Krzysztof Halasa
2005-12-17  1:31   ` Rusty Russell
2005-12-17 15:16     ` Krzysztof Halasa
2005-12-15 20:52 ` Dave Jones
2005-12-15 22:58   ` Krzysztof Halasa
2005-12-16 22:28 ` Jan Engelhardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox