Subject: Re: killing the unkillable
To: Jeremy C. Reed <reed@reedmedia.net>
From: Lord Isildur <mrfusion@uranium.vaxpower.org>
List: tech-kern
Date: 11/08/2002 13:01:47
well, if you go the debugger route, just find the address it's sleeping on
(the wait channel), and pop into th debugger (i think ddb can call 
functions too, right?) and call wakeup(foo) for some wait channel foo. 
all processes waiting on foo will then wake up. 
To do it in an lkm, youd have to basically write a very short small lkm 
that just calls wakeup on that address, and then is done. ive never 
written an lkm so i am of no help in further detail on how to do it. 
as for a tool to do it.. no, i dont think it is much needed. This 
condition is rather uncommon, plus there are mechanisms to already deal 
with it.. plus, it requires calling code from inside the kernel either 
way, so a userland program would likely just load an lkm.. it would be 
little more than a one line shell script, and for that, you may as well 
just load it manually. you'd probably have to reocmpile it for different 
uses anyway. 

Isildur

On Fri, 8 Nov 2002, Jeremy C. Reed wrote:

> 
> On Fri, 8 Nov 2002, Andrew Brown wrote:
> 
> > the numeric wait channel is what you want.  to wake up the sleeping
> > process, though, *will* require the use of the debugger.  or an lkm.
> > you can't simply call wakeup() from userland.
> 
> Can you share any examples (or point me to docs) on doing this?
> 
> Would it be useful to have some tool (that works with a lkm or via ddb) to
> do this?
> 
> For your info, these are my four stuck processes:
> 
> ------------------- 1 -------------------
> %CPU	0.0
> %MEM	0.0
> ACFLG	0
> CPU	0
> F	4002
> INBLK	0d
> JOBC	0
> HOLDCNT	0
> KTRACE	80000010
> KTRACEP	cb7409f4
> LIM	-
> LOGIN	reed
> STARTED	-
> MAJFLT	0d
> MINFLT	0d
> MSGRCV	0d
> MSGSND	0d
> NI	0
> NIVCSW	0d
> NSIGS	0d
> NSWAP	0d
> NVCSW	0d
> WCHAN	c03ec040
> OUBLK	0d
> P_RU	cb60f00c
> PADDR	cb64e574
> PAGEIN	0
> PGID	5998
> PID	5998
> PPID	1
> PRI	-2
> RE	127
> RGID	0
> RLINK	0
> RSS	4
> RSZ	4
> RUID	0
> RUSER	root
> SESS	8b1bc0
> PENDING	24102
> CAUGHT	0
> IGNORED	98488000
> BLOCKED	0
> SL	127
> STARTED	-
> STAT	DW
> SVGID	0
> SVUID	0
> TDEV	5/13
> TIME	0:00.00
> TGPID	27306
> TSESS	c08cf840
> TSIZ	184
> TT	pd-
> TTY	ttypd
> UCOMM	umount
> UID	0
> UPR	50
> USER	root
> VSZ	224
> WCHAN	synclk
> XSTAT	0
> COMMAND	umount
> 
> ------------------- 2 -------------------
> %CPU	0.0
> %MEM	0.0
> ACFLG	0
> CPU	0
> F	4002
> INBLK	0d
> JOBC	0
> HOLDCNT	0
> KTRACE	0
> KTRACEP	0
> LIM	-
> LOGIN	reed
> STARTED	-
> MAJFLT	0d
> MINFLT	0d
> MSGRCV	0d
> MSGSND	0d
> NI	0
> NIVCSW	0d
> NSIGS	0d
> NSWAP	0d
> NVCSW	0d
> WCHAN	c03ec040
> OUBLK	0d
> P_RU	cb64f014
> PADDR	cb9f09fc
> PAGEIN	0
> PGID	4077
> PID	4077
> PPID	1
> PRI	-2
> RE	127
> RGID	0
> RLINK	0
> RSS	4
> RSZ	4
> RUID	0
> RUSER	root
> SESS	912300
> PENDING	4100
> CAUGHT	0
> IGNORED	98488000
> BLOCKED	0
> SL	127
> STARTED	-
> STAT	DW
> SVGID	0
> SVUID	0
> TDEV	5/36
> TIME	0:00.00
> TGPID	4417
> TSESS	c089ab00
> TSIZ	184
> TT	r4-
> TTY	ttyr4
> UCOMM	umount
> UID	0
> UPR	50
> USER	root
> VSZ	224
> WCHAN	synclk
> XSTAT	0
> COMMAND	umount
> 
> ------------------- 3 -------------------
> %CPU	0.0
> %MEM	0.0
> ACFLG	1
> CPU	0
> F	2
> INBLK	0d
> JOBC	0
> HOLDCNT	0
> KTRACE	800001be
> KTRACEP	cb740854
> LIM	-
> LOGIN	heather
> STARTED	-
> MAJFLT	0d
> MINFLT	0d
> MSGRCV	0d
> MSGSND	0d
> NI	0
> NIVCSW	0d
> NSIGS	0d
> NSWAP	0d
> NVCSW	0d
> WCHAN	c0952150
> OUBLK	0d
> P_RU	cb60f008
> PADDR	cb7cd3b8
> PAGEIN	0
> PGID	4223
> PID	4224
> PPID	1
> PRI	-2
> RE	127
> RGID	0
> RLINK	0
> RSS	4
> RSZ	4
> RUID	0
> RUSER	root
> SESS	8442c0
> PENDING	44100
> CAUGHT	60004eff
> IGNORED	98489000
> BLOCKED	4000
> SL	127
> STARTED	-
> STAT	DW
> SVGID	0
> SVUID	0
> TDEV	5/261
> TIME	0:00.00
> TGPID	25148
> TSESS	c08ad6c0
> TSIZ	64
> TT	pl-
> TTY	ttypl
> UCOMM	shlight
> UID	0
> UPR	50
> USER	root
> VSZ	252
> WCHAN	mntwcnt2
> XSTAT	0
> COMMAND	/usr/pk
> 
> ------------------- 4 -------------------
> %CPU	0.0
> %MEM	0.0
> ACFLG	0
> CPU	0
> F	4002
> INBLK	0d
> JOBC	0
> HOLDCNT	0
> KTRACE	0
> KTRACEP	0
> LIM	-
> LOGIN	heather
> STARTED	-
> MAJFLT	0d
> MINFLT	0d
> MSGRCV	0d
> MSGSND	0d
> NI	0
> NIVCSW	0d
> NSIGS	0d
> NSWAP	0d
> NVCSW	0d
> WCHAN	c0952000
> OUBLK	0d
> P_RU	cb60f050
> PADDR	cb9410b4
> PAGEIN	0
> PGID	4331
> PID	4331
> PPID	1
> PRI	-2
> RE	127
> RGID	0
> RLINK	0
> RSS	4
> RSZ	4
> RUID	0
> RUSER	root
> SESS	936000
> PENDING	4103
> CAUGHT	0
> IGNORED	98488000
> BLOCKED	0
> SL	127
> STARTED	-
> STAT	DW
> SVGID	0
> SVUID	0
> TDEV	5/262
> TIME	0:00.00
> TGPID	23708
> TSESS	c091c180
> TSIZ	4
> TT	pm-
> TTY	ttypm
> UCOMM	unshlight
> UID	0
> UPR	50
> USER	root
> VSZ	28
> WCHAN	vfs_busy
> XSTAT	0
> COMMAND	/usr/pk
> 
> 
> Thank you Isildur and Andrew for your comments.
> 
> (Please continue to Cc me.)
> 
>    Jeremy C. Reed
>    http://bsd.reedmedia.net/
> 
> 
> 
>