atom feed24 messages in org.freebsd.freebsd-archkldunload DIAGNOSTIC idea...
FromSent OnAttachments
Poul-Henning KampJul 20, 2004 11:21 am 
Brian Fundakowski FeldmanJul 20, 2004 11:32 am 
Poul-Henning KampJul 20, 2004 11:40 am 
Brian Fundakowski FeldmanJul 20, 2004 11:53 am 
Willem Jan WithagenJul 20, 2004 12:08 pm 
Scott LongJul 20, 2004 12:09 pm 
Scott LongJul 20, 2004 12:11 pm 
David SchultzJul 20, 2004 1:40 pm 
Andrea CampiJul 20, 2004 11:18 pm 
Poul-Henning KampJul 20, 2004 11:47 pm 
Julian ElischerJul 21, 2004 12:09 am 
Doug RabsonJul 21, 2004 2:10 am 
Poul-Henning KampJul 21, 2004 2:22 am 
Doug RabsonJul 21, 2004 3:37 am 
Poul-Henning KampJul 21, 2004 4:02 am 
Doug RabsonJul 21, 2004 4:20 am 
Poul-Henning KampJul 21, 2004 4:37 am 
Doug RabsonJul 21, 2004 5:20 am 
Poul-Henning KampJul 21, 2004 5:30 am 
M. Warner LoshJul 21, 2004 7:51 am 
Brian Fundakowski FeldmanJul 21, 2004 8:08 am 
Poul-Henning KampJul 21, 2004 9:38 am 
M. Warner LoshJul 21, 2004 10:14 am 
Poul-Henning KampJul 21, 2004 10:16 am 
Subject:kldunload DIAGNOSTIC idea...
From:Poul-Henning Kamp (ph@phk.freebsd.dk)
Date:Jul 20, 2004 11:40:10 am
List:org.freebsd.freebsd-arch

In message <2004@green.homeunix.org>, Brian Fundakowski Feldma n writes:

On Tue, Jul 20, 2004 at 08:20:23PM +0200, Poul-Henning Kamp wrote:

I'm pulling hair out trying to make it guaranteed safe to unload device driver modules, and the major pain here is to make sure there is no thread stuck somewhere inside the code.

That gave me the idea for a simple little DIAGNOSTIC check for kldunload: run through the proc/thread table and look for any thread with an instruction counter inside the range of pages we are going to unload.

Any takers ?

You mean any thread with a stack trace that includes an instruction counter inside those pages, don't you?

That would require us to unwind the stack which I think is overkill for the purpose.

The most likely case is that the thread is sleeping on something inside the kld so just checking the instruction pointer would be fine.

Looking for sleep addresses inside the module might make sense too.