Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Nov 2003 13:19:29 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Poul-Henning Kamp <phk@phk.freebsd.dk>
Cc:        current@freebsd.org
Subject:   Re: DIAGNOSTIC LOR in softclock
Message-ID:  <20031116131305.V3251@gamplex.bde.org>
In-Reply-To: <17495.1068921380@critter.freebsd.dk>
References:  <17495.1068921380@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
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) @ kern/kern_timeout.c:223
>  2nd 0xc072d080 allproc (allproc) @ 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031116131305.V3251>