Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 May 2014 11:48:42 -0400
From:      John Baldwin <jhb@FreeBSD.org>
To:        Chris Torek <torek@torek.net>, freebsd-hackers@freebsd.org
Subject:   Re: bad call to sched_bind() => hang, even with INVARIANTS
Message-ID:  <5378D65A.90905@FreeBSD.org>
In-Reply-To: <201405151720.s4FHK8RC065430@elf.torek.net>
References:  <201405151720.s4FHK8RC065430@elf.torek.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On 5/15/14, 1:20 PM, Chris Torek wrote:
> I was poking around with a bhyve emulation, where the emulation
> has only one CPU but the real systems have more.
> 
> In our real-system code we had a sched_bind() that just assumed there
> were 2 or more CPUs, instead of just the 1.  This caused the entire
> system to hang.  (Note: using SCHED_ULE.)
> 
> It's not immediately obvious to me what went wrong "underneath" to
> cause the whole-system hang, but clearly it is wrong to attempt to
> pin a thread to a CPU that does not exist.  Should sched_bind()
> have a KASSERT in it to make sure that the cpu argument is
> sensible?  (Or maybe even something a little more aggressive?)

A KASSERT() is probably a good idea.

-- 
John Baldwin



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