mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-30 13:44:55 +00:00
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
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=239585
|
@ -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 a new issue