Re: DIAGNOSTIC LOR in softclock

From: Bruce Evans <bde_at_zeta.org.au>
Date: Sun, 16 Nov 2003 13:19:29 +1100 (EST)
On Sat, 15 Nov 2003, Poul-Henning Kamp wrote:

> This looks slightly different if I use SCHED_ULE, but the effect is
> the same.
>
> Off the top of my head, I have not been able to find any places
> where softclock would call schedcpu directly.

schedcpu() is a timeout routine, so it is always called indirectly from
softclock.

> lock order reversal
>  1st 0xc072dca0 callout_dont_sleep (callout_dont_sleep) _at_ kern/kern_timeout.c:223
>  2nd 0xc072d080 allproc (allproc) _at_ kern/sched_4bsd.c:257
> Stack backtrace:
> backtrace(c06d148d,c072d080,c06cd881,c06cd881,c06cf38b) at backtrace+0x17
> witness_lock(c072d080,0,c06cf38b,101,c5061c3c) at witness_lock+0x672
> _sx_slock(c072d080,c06cf382,101,8,c06cf0a0) at _sx_slock+0xae
> schedcpu(0,0,c06cf097,df,c1183140) at schedcpu+0x3f
> softclock(0,0,c06cbce6,23a,c1189388) at softclock+0x1fb
> ithread_loop(c1180400,c5061d48,c06cbb54,311,558b0424) at ithread_loop+0x192
> fork_exit(c050b090,c1180400,c5061d48) at fork_exit+0xb5
> fork_trampoline() at fork_trampoline+0x8
> --- trap 0x1, eip = 0, esp = 0xc5061d7c, ebp = 0 ---

I'm sure this is known.  schedcpu() always calls sx_lock(&allproc_lock),
so the above always occurs if sx_lock() happens to block.

Bruce
Received on Sat Nov 15 2003 - 17:19:48 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:29 UTC