Mark the idle threads as non-sleepable and also assert that an idle

thread never blocks on a turnstile.
This commit is contained in:
John Baldwin 2012-08-22 20:01:38 +00:00
parent e6bdd477fc
commit ba96d2d816
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=239585
3 changed files with 3 additions and 0 deletions

View File

@ -1598,6 +1598,7 @@ sched_idletd(void *dummy)
{
struct pcpuidlestat *stat;
THREAD_NO_SLEEPING();
stat = DPCPU_PTR(idlestat);
for (;;) {
mtx_assert(&Giant, MA_NOTOWNED);

View File

@ -2581,6 +2581,7 @@ sched_idletd(void *dummy)
mtx_assert(&Giant, MA_NOTOWNED);
td = curthread;
tdq = TDQ_SELF();
THREAD_NO_SLEEPING();
for (;;) {
#ifdef SMP
if (tdq_idled(tdq) == 0)

View File

@ -684,6 +684,7 @@ turnstile_wait(struct turnstile *ts, struct thread *owner, int queue)
if (owner)
MPASS(owner->td_proc->p_magic == P_MAGIC);
MPASS(queue == TS_SHARED_QUEUE || queue == TS_EXCLUSIVE_QUEUE);
KASSERT(!TD_IS_IDLETHREAD(td), ("idle threads cannot block on locks"));
/*
* If the lock does not already have a turnstile, use this thread's