Mark the idle threads as non-sleepable and also assert that an idle
thread never blocks on a turnstile.
This commit is contained in:
parent
e6bdd477fc
commit
ba96d2d816
@ -1598,6 +1598,7 @@ sched_idletd(void *dummy)
|
||||
{
|
||||
struct pcpuidlestat *stat;
|
||||
|
||||
THREAD_NO_SLEEPING();
|
||||
stat = DPCPU_PTR(idlestat);
|
||||
for (;;) {
|
||||
mtx_assert(&Giant, MA_NOTOWNED);
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user